Answer
A squatter is a person who lives in a property without the permission of the owner. A squatter is not a person who has defaulted on rent payments and this answer does not apply to them, see SQ46 and SQ47 for information about tenants.
In Scotland, if someone makes attempts to enter or enters the dwelling house of another or is residing there without permission then they may be liable to criminal prosecution or civil proceedings. Squatters rights do not apply in Scotland.
This is a summary of some of the provisions in the Criminal Law Act 1977. It is intended to be a guide and you would be wise to seek professional advice about the exact provisions, as you could be liable for a criminal offence or be sued if you get it wrong.
Categories of individuals that are able to take reasonably direct action
1. A person who lives at domestic premises and is away, perhaps on holiday, when the squatters move in is called a 'displaced residential occupier'.
2. A person who is intending to live at the premises as an owner, under a leasehold agreement (but only so long as there is two years left) or most rental agreements (but not all) is called 'protected intending occupiers'.
A displaced residential occupier, a protected intending occupier or a person acting on their behalf can use reasonable force to secure entry to the property. However…
Before this can be done a written declaration must be obtained from a commissioner of oaths (usually certain more senior solicitors). Once this has been obtained then entry can be gained. If the squatters refuse to leave then they commit an offence and the police should be called to deal with the matter.
Any person using excessive force could leave themselves open to criminal and civil proceedings.
Outside the above provisions, a landlord/owner etc. cannot force entry into property where there are squatters whilst someone is inside. However, they can get a court order fairly easily and deal with the matter by that means.