A landlord will usually let out a residential property under a tenancy agreement. Sometimes the tenant will vacate the property, leaving behind someone else who is not named on the tenancy agreement.
The first thing to do is check what the tenancy agreement says. Most will limit the tenant's ability to assign or sublet the tenancy by requiring the landlord's consent to do so. If you did not consent to this occupation, then the occupation is unlawful.
If the occupier is the tenant's spouse or civil partner, they may be deemed to occupy on behalf of the absent tenant. However, if the occupier is just another family member or friend, you should consider the following options.