In order to solve an equation by factoring, it should be that the equation is equal to zero.
m^2 + 8m + 7 = 0
For this case we have, to do completing the square in order to factor this equation.
m^2 + 8m = -7
m^2 + 8m + 16 = -7 +16
(m+4) (m+4) = 9
(m+4)^2 = 9
Take the square root of both sides,
m+4 = 3
m = -1