Find the unit rate first, and then multiply it by 8:
2 3/5 boxes
---------------- = 13/5 divided by 7/2.
3 1/2 roofs
You can obtain the correct result by inverting the divisor, 7/2, and then multiplying:
13/5 times 2/7. This comes out to 26/35. That represents 26/35 box of nails per roof.
To do 8 roofs (not roves), you'd need (26/35)(8/1) boxes: 5.94 boxes. Why not buy 6 boxes to be sure you'll have enough?