Where I live, when I was too young to buy, mortgage was cheaper.
When I was old enough to buy, rent was cheaper and prices had already risen enormously, so I stuck with rent, and hoped prices would stabilise or fall. In retrospect this was a mistake, as prices continued to rise.
Now mortgages are cheaper than rent again.
It's hard to beat the SP500's >8% average return [2].
[1] (paywalled) https://www.nytimes.com/interactive/2014/upshot/buy-rent-cal...
[2] https://www.investopedia.com/ask/answers/042415/what-average...
Then, I live in Germany.
There is a 28% tax on stock market returns, but selling your home is tax free
Also capital gains tax is around 26% (incl. solidarity surcharge), if it hasn't changed.
However there are other scary things about house ownership in Germany. For example being liable for street work in front of your house for the first few decades. The city can decide to repave the street and stick residents with the bill.