Sharing housing with anyone else than your partner is consider lodging. The legal protection for lodgers are inferior compared to the protection for the actual tenant (the one who’s name is on the contract). Most importantly, little is required for the tenant to terminate the contract of a lodger. In general, it lodging is allowed. Some landlords have special rules, especially when it comes to dorms.