Count the days
That you spend in your new state of residency, that is. To avoid getting dunned by your old state, you should spend at least 183 days (184 in a leap year) in the new locale. There's even a iPhone app, called USTaxDays, that helps keep track of your presence.