Breaking and entering (allanamiento de morada) is the offence committed by someone who, without living there, enters another person’s dwelling or stays in it against the will of the person who lives there.
It is set out in article 202 of the Código Penal (Spanish Criminal Code), which punishes more severely the cases involving violence or intimidation. Article 203 deals separately with entry into offices, professional premises and establishments open to the public.
The key lies in the word morada, the dwelling: the place where a person lives and conducts their private life. Whether a particular home is a dwelling or not, for example a second home used for part of the year, is assessed case by case. When the property is not a dwelling, the offence is known as usurpación.
If you find someone inside your home, do not go in or confront them: call the police and consult a lawyer. To protect your home, see protection against squatters.