As another commenter stated, it's important to compare apples to apples and calculate everything fairly.
When I did that here: https://medium.com/financial-strategy/if-youre-renting-your-home-you-need-to-see-this-1dd55f06dfa I found that (with possible temporary exceptions in specific markets), owning a home is expensive and drags on your net worth, but renting is even more expensive and drags on your net worth far worse, even just 3 years in.
The biggest caveats are that buying makes more sense if:
- You're staying in one place for more than a couple or three years
- You can pull together a large enough down payment to avoid PMI
- Your income is stable enough and your credit score good enough that you can get a decent interest rate on your mortgage
- You're comparing buying to renting a similar home (if you're planning to buy a 4-bedroom house in a good neighborhood, but would be willing to rent a 3-bedroom at a lower-cost neighborhood, the comparison breaks down).