Which state to File?

Hello,

I am a member of the US Public Health Service (one of the seven uniformed services in the military). I have been in the Public Health Service for several years now and have a home of record of NY (where I lived before joining the public health service). My last updated state of legal residence is Arizona (but I beilieve could change this to ND since I'm living here now).

Last year (in 2019), I worked in both AZ (Jan 1 through July 18) and then moved to ND in July. What state(s) should I complete tax returns for?

Thank you for your time!