This topic has come up quite a few times over the years on this board. A lot of the discussion around it has mostly been others opinions. I found this neat little graph online (instagram) from the New York Times that compares the two. Now keep in mind one's location will certainly have an effect on which one might make more sense, even in what part of you own country you're in.
Of course, it will depend on several things that influence someone to decide or decide to buy a house or rent a home temporarily.
1. Money
Money is the main reason why someone decides to buy or rent a house, if they have enough money and it meets the criteria for the house they want, it would be better for me to buy a house immediately, because the further you get here, the more the property price will rise. However, if you don't have enough money, it can't be helped, renting a house might be an option. There are indeed ways to buy a house using a credit system or a loan from a bank, but not everyone wants to do it or not everyone can do it and is approved to do it for several reasons.
2. Period of residence in the current area of residence
So, the period for how long you will occupy your current domicile will also have an influence. If it's possible that it won't take long, it's better to rent a house first rather than having to bother taking care of other things to buy a house in another place.
Personally, buying a house is actually one of my main targets besides a vehicle because it is for the benefit of the family. If you have settled down, the money is ready, and there is a house that is really suitable and the environment is suitable for us, then that will be my reason to buy it immediately.