Under S1(2) Protection from Eviction Act 1977 it is an offence for any person to unlawfully deprive a residential occupier of the premises (or any part of it) that they occupy.
In the main, a Notice of some sort, followed by a Possession Summons, then a Possession Order is the usual procedure. Even when the Possession Order expires, the tenants can stay in place until the landlord obtains a Bailiffs Warrant of Execution. Only the County Court Bailiff can carry out the eviction.
For an excluded tenant (and these are mainly tenants sharing facilities with the landlord in his main household) only reasonable notice may be given. This is usually related to the length of rental period. Ultimately, the reasonableness of the Notice period may be for the courts to decide, as in some cases, immediate notice may be held to be reasonable. The notice does not have to be in writing, and this often leads to disputes over whether or not the notice was given and when it does in fact expire. After such notice period, it is lawful to change the locks and exclude the tenant. At that the eviction is complete and the tenant would thereafter be a trespasser.
There is a Statutory Defence to Unlawful Eviction if the accused can prove that he believed and had reasonable cause to believe that the residential occupier had ceased to reside on the premises. This will always be a question of fact for the Jury to decide.
The offence is committed against the "residential occupier" so it follows that if a person is not the residential occupier, no offence is committed but, in reality, due to the Criminal Law Act 1977, anyone (including a trespasser) can be a residential occupier.
A "Residential Occupier" is defined in S1(1) as "A person occupying the premises as residence, whether under a contract, or by virtue of any enactment or rule of law giving him the right to remain in occupation, or restricting the right of any other person to recover possession of the premises.
Bare Licensees, contractual licensees and excluded tenants can be treated as trespassers once their notice has expired. Unlawful sub-tenants may be trespassers once the mesne tenancy has ended, but the Courts are undecided. It will need an Appeal case to decide.
Tenants licensees also become trespassers as soon as the tenants interest has been effectively terminated unless the landlord continues the licence after the tenant has departed.
Deserted spouses can acquire rights of occupation under the Matrimonial Homes Act 1983 S1 if they are not already joint tenants.