I've finished my bachelor's degree at a university from 2012-2015. Now I get my master's degree of another university from 2017-2018. I was back to my home country during the gap year, about 1.5 years. Now I work under the OPT status.
Because I'm going to report the tax in the next year, I don't know if I should report tax as a non-resident alien or a resident alien. Based on my understanding, the criteria to determine the non-resident alien or the resident alien for F1 visa is the duration time stayed in the United States, which is 5 years.
Do I calculate my duration time in the United States since the first time I came to the United States in 2012 or since the second time I came for the Master's degree in 2017?