Let t denote the working time (in hours!) of the second person. Then the first person works only (t - 2) hours. Therefore the complete work is done:
Divide by W, expand the brackets and collect like terms:
Since your question asks "...how many hours will it take them working together?" the answer is 4 hours.