Rank of matrix is maximum number of linearly independent rows.
Let rows of the given matrix be $R_1, R_2, R_3$.
Now, since the rank of the matrix is given as $2$,
and as we can see $R_1$ and $R_2$ are linearly independent, $R_3$ must be a linear combination of $R_1$ or $R_2$.
So, now check the last element in $R_3$. It's $1$.
which could come by doing one of the following transformations -
1. $R_3 = R_3 - \frac{1}{2}R_1$ ---> Generates $R_3$ as $(\begin{matrix} a & a & b& 1 \end{matrix})$
2. $R_3 = R_3 - \frac{1}{3} R_2$ ---> Generates $R_3$ as $(\begin{matrix} a & b & b & 1 \end{matrix})$
So, second way is to go. hence option (D).
Note that $a = b$ in the second case above, but that's not relevant to the question.