You are a part-year resident of each state if you moved.
If you regularly live in both states, then your resident state is the state in which you have established a "permanent" residence. To determine permanent residency, some things that would be considered are owning a home, where your driver's license is from, and where you are registered to vote.
If you made a permanent move to one state, then that is your permanent residence state, even if you haven't purchase property.
If you have a second home in one of the states, then that state is the non-resident state.
How do I file if I move to a different state
last year?
https://ttlc.intuit.com/replies/3302342
How to file a non-resident state return?
https://ttlc.intuit.com/replies/3302052