Do the grouping $am_{2}x+bm_{2}x+2a+2b=\left(am_{2}x+bm_{2}x\right)+\left(2a+2b\right)$, and factor out $m_{2}x$ in the first and $2$ in the second group.
$$m_{2}x\left(a+b\right)+2\left(a+b\right)$$
Factor out common term $a+b$ by using distributive property.