Two ledgers, one scenario
Both paths start from the same facts: price, down payment, mortgage rate, holding period. The buy path charges the down payment, closing costs, and monthly mortgage, tax, insurance, and maintenance; the rent path charges rent and invests the down payment plus any monthly surplus at the assumed return. Principal repaid counts as savings, not cost: it stays in the home as equity.