Knowing where to use componendo and dividendo is just a result of building one's intuition through practice.
You'll notice that, if I write $\theta = B$ and $\phi = 2A + B$, then
$$
\frac{\phi - \theta}{2} = A
$$
and
$$
\frac{\phi + \theta}{2} = A + B
$$
which are exactly the angles that you expect in the result.
If you now take the sines to the same side, in the form of a fraction, and then apply componendo and dividendo, this allows you to transform the sums of sines into products, with the arguments of the resulting sines and cosines being the angles you expect.
You can get around using componendo and dividendo, but that'll make the solution longer.