The numerator is already "factorized". What you did was multiply, the opposite of "factorizing".
Yes, \(\displaystyle \frac{(ax- x)(2+ ax)}{3x^2+ 1}= \frac{(ax)(2)+ (ax)^2- 2x- ax^2}{3x^2+ 1}=\frac{(a^2-a)x^2+ (2a- 2)x}{3x^2+ 1}\).
Now we need to take the limit as x goes to infinity. It is difficult to deal with "infinity" but fairly easy to deal with "zero" and as x goes to infinity 1/x goes to 0. So to deal with limits as x goes to infinity, often the best thing to do is to divide both numerator and denominator by the highest power of x in the problem.
Here that highest power of x is \(\displaystyle x^2\). Dividing both numerator and denominator by \(\displaystyle x^2\) gives \(\displaystyle \frac{(a^2- a)\frac{x^2}{x^2}+ (2a+ 2)\frac{x}{x^2}}{3\frac{x^2}{x^2}+ \frac{1}{x^2}}\)\(\displaystyle = \frac{(a^2- a)+ (2a+ 2)\frac{1}{x}}{3+ \frac{1}{x}}\).
Now, as x goes to infinity the "\(\displaystyle \frac{1}{x}\)" terms go to 0 so the limit is \(\displaystyle \frac{a^2- a}{3}\). So now the question is "What value of a makes \(\displaystyle \frac{a^2- a}{3}= 2\)?
Can you answer that?