Residency is based on a couple of things... The address which you state on your state & federal tax return and you must reside at that address for more than 183 days to be considered a resident of that state. I am sure there is fine print and some loops holes as with any law but that is the basics for what determines residency.
This issue is always in the news around here (Boston) as Massachusetts has VERY high auto insurance rates and taxes in general while bordering New Hampshire which has very LOW insurance rates (and no sales tax). You can figure out peoples thoughts and actions ... so the state of MA started a media campaign on this issue a couple years back which still shows up on the news occasionally as the registry of motor vehicles does frequent "sweeps" and also offers a $$$ reward for turning someone in who resides in Mass and has NH registry plates.
It would be great though if we could claim FL residency from a timeshare ownership...