In Denmark, there is bopælspligt in most homes. It means that the owner has to either live in the house/apartment himself or make sure somebody else does. The idea is to prevent property speculation and depopulation.
In some cases, with new apartment buildings, for instance, there is no residency requirement (bopælspligt). In this type of property, it is not always possible to register CPR address but it is still legal to rent and live in the apartment.