Let x be the work done in a hour by both of them:
1/5 + 1/7 = x
7/35 + 5/35 = 12/35
That means in a hour, they can do 12/35 of the house.
Which means, the entire work can be done in 35/12 hours (since the amount done in a hour multiplied by the number of hours should give 1 or if you prefer ).
35/12 = 2.916 hours or 2 hours and 55 minutes rounded.