Help! How do I determine which state I was a resident of?

I worked in Missouri for 7 months in 2022. Since I was laid off, I moved in with my Parents in Arizona for the remaining 5 months as I looked for a new job. I don't know which state my new job will be in. For income tax purposes, how do I determine my state of residence? Missouri makes sense as I worked there and I am in Arizona only temporarily. Arizona may make sense because my driver's license is from Arizona; however, I have never worked in or gone to school in Arizona. 

Help!