Given
6 years is 120000
HouseB is 1500 per month
12 * 1500 = 180000
Since there's 12 months in a year and every month you pay 1500 in rent
180000 * 60 (5 * 12 = 60 which means 60 months in total for rent)
180000 * 60 = 10,800,000 dollars.
So after 6 years the person who owns a home pays a total of 120000 while the person renting the some what of the same home pays 10800000 dollars.
Subtract 10,800,000 - 120000 = 10680000
Costs 10,680,000 dollars more renting the home after 6 years then buying/owning it for 120,000.