The questions that matter more than the headline answer, and a calculator for the money side.
Buying is a commitment to a place and a debt. Renting is flexibility and no stake in the building. If your job, family or plans may move you within a few years, the money case for buying weakens, because the costs of buying and selling are paid up front and recovered slowly.
Compare what owning costs each month, including interest, maintenance and property tax, with the rent for a similar home. Then count the money you would not have tied up in a down payment if you rented, and what it could earn. Neither side of that comparison is certain: price growth, rent growth and returns are assumptions, so try a range.
The buy-or-rent calculator on this site lets you change every assumption and shows the year at which owning overtakes renting, or says it does not within the period you chose.
This guide is general information, not legal, tax or financial advice. Rules differ between states and change over time, so confirm the details that matter to you with a qualified professional or the authority concerned before you act.