Your second option is correct.
Once you have the step 3 x2(x+2)-1(x+2)
You can combine the two (x+2)s and connect the x2 with the -1 as so:
(x2-1)(x+2)
Now, (x2-1) can be rewritten as:
(x-1)(x+1)
So total, for step 5:
(x-1)(x+1)(x+2)
I hope this Helps!