The first option is the right one.
You have to find the greates common divisor of the coefficientes, which is -6 and then divide each momomial with lead to: -6 (m^2 + -3m + 6).
You can verifiy the result by multiplying -6 times the polynomial inside the parenthesis, using the distributive property.