What the comparison includes
Buying: deposit, buying costs, mortgage payments, property tax, maintenance and insurance, minus the sale price after selling costs and the remaining loan.
Renting: rent that rises each year, minus the growth you'd earn by investing the deposit and buying costs instead.