The residency test is one of three tests used to determine if you qualify for the Foreign Earned Income Exclusion. You can pass either the Bona Fide Residence test or the Physical Presence test to pass the residency test.
Bona Fide Residence Test
To qualify for the bona fide residence test, you must reside in a foreign country for an uninterrupted period that includes an entire tax year. Additional items taken into consideration are the purpose for your trip (you need to be doing something that generates earned income), as well as the nature and length of your stay abroad.
You may retain your domicile in the US (which is the place you consider your permanent home and to which you intend to return). You may also retain the right to vote by absentee ballot in any US elections.
Uninterrupted Period It is not required that you stay in the country where you are trying to establish yourself as a bona fide resident for the entire 365 days of the year. You are allowed temporary trips out of the Country for business or pleasure as long as you intend to return from those trips and do in fact return.
Entire Tax Year You must be in the foreign country as a bona fide residence from January 1 to December 31 for your first year to take the foreign earned income exclusion. (If you file on a fiscal year, then it would be for the period of your fiscal year.) Once the bona fide residence requirement is met, you are permitted the exclusion for any tax year in which the period ended, even if the period ends before December 31.
Physical Presence Test
To meet the physical presence test, you must be physically present in a foreign country or countries for at least 330 full days during a period of twelve consecutive months. You do not have to be present in the foreign country solely for business purposes and the 330 days do not have to be consecutive. Also, you can select any twelve month period in which you are present to meet the test.
Physically Present This term basically means that the test is only concerned with how long you are in a foreign country or countries. It is not interested in the purpose for your stay abroad or your intention of returning to the US.
12 Consecutive Months The 12 months can be any consecutive 12 months even if they do not constitute a calendar year. There is great flexibility in choosing the 12 months, so the 12 months that give you the greatest income exclusion will be selected.
Full Day A full day is a period of 24 hours in a row, beginning at midnight. The full days must be spent entirely in the foreign country, traveling over international waters does not count.
Exception To The Rule If you must leave the country because of war or civil unrest, you may still pass the physical presence test. If you leave because of illness or your employer ends your job there and you have not met the time requirements, you will not qualify under the physical presence test.