Buying beats renting when you stay long enough for appreciation and principal to outrun the roughly 8 to 10 percent round trip cost of buying and selling, which in most markets means about five years, and renting wins whenever you might move before then.
The comparison people usually make is rent against the mortgage payment, and it is the wrong one. The right comparison is the total cost of renting against the total cost of owning, including the costs of owning that a landlord currently pays for you, and the return on the money a down payment would otherwise be earning.
What each side actually costs
Renting costs the rent, renters insurance, and whatever the rent rises to over the years you stay. That is the whole list, and its risk is that the number is not yours to control.
Owning costs the mortgage interest, property tax, homeowners insurance, any HOA dues, and maintenance, which runs roughly 1 percent of the value a year averaged over time and arrives in lumps. Principal is not a cost, it is savings you are forced to make. The down payment has an opportunity cost, because invested elsewhere it would have earned something.
The break-even
Buying costs 2 to 5 percent in closing costs and selling costs more, so a purchase starts several percent underwater and has to climb out. Five years is the usual rule of thumb, shorter where rents are high relative to prices and longer where prices are high relative to rents.
The ratio worth looking up for your own market is the median price divided by the annual median rent. Under about 15, buying tends to win quickly. Over about 20, renting and investing the difference is genuinely competitive for a long time.
The parts that are not arithmetic
Owning fixes your housing cost against rent increases, and that is worth real money over a decade. It also fixes you in place, hands you every repair, and turns a job offer in another city into a transaction.
Renting buys flexibility and a phone number to call when the water heater fails. Neither is the right answer in general. They are the right answers to different lives.
Questions people ask
Is renting really throwing money away?
No. Rent buys shelter and flexibility, and a good deal of an early mortgage payment is interest, tax and insurance, which buys the same shelter and no equity either.
How many years do you need to stay for buying to pay off?
About five in most markets, and the number moves with the price-to-rent ratio, how fast rents are rising, and how much the round trip costs where you are.
Does it make sense to buy if rates are high?
It can. A high rate raises the payment but usually softens prices and competition, and the rate can be refinanced later while the price paid cannot be.