let's recall that d = rt, distance = rate * time.
he went upstream to a distance "d", got tired and came back to his starting point, so he rowed back a distance "d" exactly.
we know the rates, we also know the trip took 2 hours, let's say on the way over he took "t" hours to get there, on the way back he lasted then "2 - t" hours.