The total cost was $27. The total cost is made up of a fixed amount, $13, and an hourly amount. Subtract the fixed amount from the total cost to find the hourly amount.
$27 - $13 = $14
$27 = total cost
$13 = fixed cost
$14 = hourly cost
Since the hourly rate is $7/hour,
$14/($7/hr) = 2 hours
He rented for 2 hours.