But mainly it's checked by seeing if any person has their primary residence registered at each address zoned to housing. Or by filling in a form saying it's rented out to someone living their temporarily, like seasonal workers, students at the ski academy etc.
But people do try to skimp around it by living there on paper while actually living somewhere else. But than at least part of their taxes paid goes to our county. County can force them to sell, though.
there's also the matter of your person registry information being wrong all the time (since it has to be tied to something zoned as a primary residence). would be death by a thousand cuts since so many services and programs refer to this registry to automate things.