If you try to squat (okupar) the house where someone lives, you'll be evicted just when the police arrives to your house. And you'll get a criminal sanction (allanamiento de morada). The problem comes when your third house is occupied by someone, since this is not where you live, then you'll have a real problem since they can say they are living there right now, and that's when the time dilatation comes.
This "problem" is just for people with a lot of houses, rentist, that are part of the problem. Or the banks and vulture funds, who had most of the houses and flats in spain.
And the squatting problem in spain is ridiculous small. THe percentage over the poblation is ridiculous. This that, in this article, don't mention at all.