i am not sure what is the answer but i learnt to do this type of question this way:
firstly rewrite the equation
6ab-2bx+3ay-xy
then take the common out
2b(3a-x)+y(3a-x)
since the eqn in the brackets are the same, the final answer is written as:
(2b+y)(3a-x)