Step 1: Understand the problem.
There are 4 subjects: three subjects each with maximum $n$ marks, and one subject with maximum $2n$ marks. We want to count the number of ways a student can score exactly $3n$ marks in total. Each subject score is a non-negative integer within its maximum.
Step 2: Set up the generating function.
The generating function for the total score is: \[G(x) = (1+x+x^2+\cdots+x^n)^3 \cdot (1+x+x^2+\cdots+x^{2n}).\] We need the coefficient of $x^{3n}$ in $G(x)$.
Step 3: Simplify using the geometric series formula.
\[G(x) = \frac{(1-x^{n+1})^3(1-x^{2n+1})}{(1-x)^4}.\] Expanding $(1-x^{n+1})^3 = 1 - 3x^{n+1} + 3x^{2n+2} - x^{3n+3}$.
Step 4: Extract coefficient of $x^{3n}$ using $\dfrac{1}{(1-x)^4} = \sum_{r\geq 0}\binom{r+3}{3}x^r$.
The relevant terms contributing to $[x^{3n}]$ are:
$\binom{3n+3}{3}$ (from the constant 1),
$-3\binom{2n+2}{3}$ (from $-3x^{n+1}$),
$3\binom{n+1}{3}$ (from $3x^{2n+2}$),
$0$ (from $x^{3n+3}$, since $3n+3 > 3n$),
$-\binom{n+2}{3}$ (from $-x^{2n+1}$ interacting with 1),
$+3\binom{n+2}{3}$ does not apply directly (involves negative powers). Only terms $(1-x^{2n+1})\times(1-3x^{n+1}+3x^{2n+2}-x^{3n+3})$ contribute.
Step 5: Simplify the sum.
After carefully collecting all nonzero contributions and simplifying: \[N = \binom{3n+3}{3} - 3\binom{2n+2}{3} + 3\binom{n+1}{3} - \binom{n+2}{3}.\] Working through the algebra and combining like terms (a standard textbook result for this type of restricted partition): \[N = \frac{(n+1)(5n^2+10n+6)}{6}.\]
Step 6: State the final answer.
The number of ways to score exactly $3n$ marks is $\dfrac{(n+1)(5n^2+10n+6)}{6}$. \[ \boxed{\dfrac{(n+1)(5n^2+10n+6)}{6}} \]