I live in Germany. We have crazy-strong renter protection.
You cannot evict people because you want to sell (the new owner is your new landlord) or because you want to increase the rent. Unless you do something really wrong (like break things on purpose) you cannot be evicted.
About the only time to get rid of tenants is when you want to move in yourself, and then there is a longer protection time (3-9 months depending on the time you lived there). (Or I guess you can pay the renters to move out which I've seen sometimes.)
The rent can only be increased up to 15-20% in 3 years (without amenities), and can only be increased every 15 months. If you do renovations that improve the place you can demand 8% of the costs per year, but only up to 3€/sqm (or 2€/sqm if the place was cheap).
Still, prices in the cities have been going up a lot in the last few years (you can increase the rent when new tenants move in), but the prices to buy have gone up even more.