Well no matter the decision you need to make you'll definitely have to consider the cost of housing and property like in places like the United States I thinking renting will be more convinent because it's mostly a developed country and buying of landed property may be very expensive, and may also be very impossible if the country is practising a communist or socialist system of government.
However in a capitalist democratic country such as Nigeria which happens to be a developing country it'll be more advisable to buy a landed property and build your own home.
For example the cost of renting in 5 years in an urban area in Nigeria Is around 800,000 Naira (Nigerian currency) for a year, and if you multiply that by five years, that will be 4, 000,000 (4 million naira Nigerian currency) which will be enough to buy like 10 acres of a landed property in an Urban area or let's say A dream duplex with nice garden, space and parking lot in a semi rural area in Nigeria with constant electricity as well.
Like I said it depends on the country you are, check the system of government your country is practising, check the Cost of landed property and compare it to renting in the long term then you will know which is definitely the best decision. In some countries renting is better and affordable, in some buying will be better in the long run and save money. Make your research and make your choice.