Split the second term in 3g^2 + 20g + 32 into two terms
3g^2 + 12g + 8g + 32
Factor out the common terms in the first two terms, then in the last two terms;
3g(g + 4) + 8(g + 4)
Factor out the common term g + 4
(g + 4)(3g + 8)