They know. Even if they don't know they can ask for proof, and if you don't ahve it then they'll know for sure.
I know in Texas I was asked for proof (lease, work documents, etc.) before I was considered a state resident. It depends on the state though what stuff they need to see to prove you lived there for the time they state.
Also if you lie about what state, they can kick you out of med school for it, since some states have laws stating exactly what percentage of students must be state residents.