Given that $,A = \begin{bmatrix}
1 & 0 & 2 & 1 \\
0 & 2 & 4 & 2 \\
0 & 2 & 2 & 1
\end{bmatrix}$
We use elementary row operations. $R_{3} \rightarrow R_{3} - R_{2}.$
$\implies A = \begin{bmatrix}
1 & 0 & 2 & 1 \\
0 & 2 & 4 & 2 \\
0 & 0 & -2 & -1
\end{bmatrix}$
Since the echelon form has pivots in the first three columns, $A$ has rank $rk(A) = 3.$ The first three columns of $A$ are linearly independent.
$\text{(OR)}$
The maximal minors have order $3,$ and we found that the one obtained by deleting the last column is $-4 \neq 0.$ Hence $rk(A) = 3.$
So, the correct answer is $3.$