Write down when you entered and left the United States and when you moved between states. Gather records of income from each place, including outside the country. If you received a green card or were in the country on a visa, note the dates and visa type.
For non-U.S. citizens, the IRS uses the green card test and the substantial presence test, among other rules. The substantial presence test may count days from several years and has exceptions. Tax residency can change within a year. Work that out before choosing a tax form or deciding which income to include.
