How do you know what two numbers to use the break down the middle number during the first step.

Clicking on a particular step is especially helpful for examining the logic. As shown below, identifying the factors for the 1st and last term keys off of prime factors (3 divides into 12x and 2 divides into 2x.