The concept you are looking for is that of residency: because you are physically in a country doesn't mean you are a resident of that country. There are rules of residency even within the EU.
I'm not sure, but perhaps it is similar to local voting rights? Do tourists get the right to vote in local elections, or do they have to prove to have lived there for some length of time first?
Here in Norway you have to be a permanent resident to vote in local elections and a citizen to vote in national elections. I think it is broadly similar in the rest of northern Europe.