If you worked for the same employer but you lived in two different states, you may have to do two part year tax returns. Your employer should have withheld state income taxes from the state that you were a resident. When you moved to the new state, your employer should have starting deducting state income taxes for your new resident state. Your W-2 would have shown two states with two different state income tax withheld amounts.
To allocate your income, please see the three different methods in the TurboTax FAQ How do I allocate (split) income for a part-year state return?
If you worked for the same employer and the employer was located in two different sates and you were a remote employee that lived in one state, generally, you would file a tax return for your resident state.