Here in Norway the solution, as with so many other things, is taxing. Your home is evaluated at some "market rate", but if it's your primary residence the effective tax value is just 25% up to $1 million (70% on value above $1 million). For reference, a typical 3-room apartment in Oslo, the capital, is around $400-500k.
However, if it's not your primary residence, then you pay tax on 100% of the "market rate". The tax rate is 1%, so not insignificant.
Until a few years ago, tax on non-primary residences was much lower, and hence we had a lot more people buying to rent if they inherited money or similar. Some even had a dozen or more properties. These have now exited, so policy is working as intended.
One thing of course politicians for some reason didn't think of is that if most of the landlords suddenly sell, rental market will shrink. So now it's super-expensive to rent, and those who rent usually do so because they can't buy for one reason or another (no stable income to support a loan for example).