Ordinarily, you are required to file a state income tax return in every state where you earned an income. There are some exceptions, such as military personnel who are deployed outside of their state of record. Some states will let you slide if you only earned a very small income while you were there, and some states have no income tax whatsoever.
Members of the military services designate their home of record as the state in which they enlisted. Military personnel are usually considered to be residents of their state of record. The Federal Government prohibits other states from taxing the wages of non-resident military personnel stationed there.