To claim the foreign earned income exclusion, the foreign housing exclusion, or the foreign housing
deduction:

You must have foreign earned income,

Your tax home must be in a foreign country, and

You must be one of the following:

A U.S. citizen who is a bona fide resident of a foreign country or countries for an uninterrupted period that includes an entire tax
year,

A U.S. resident alien who is a citizen or national of a country with which the United States has an income tax treaty with a nondiscrimination article in effect and who is a bona fide resident of a foreign country or countries for an uninterrupted period that includes an entire tax year,
or

A U.S. citizen or resident alien who is physically present in a foreign country or countries for at least 330 full days during any period of 12 consecutive
months.

U.S. tax law does not specifically require a foreign resident visa or work visa for this purpose, but you should comply with the foreign country's
laws.

Nonresident aliens do not qualify for the foreign earned income
exclusion.

You must be either a U.S. citizen or resident alien of the United States, live and work abroad, and meet certain other qualifications to exclude a specific amount of your foreign earned
income.

If you are the nonresident alien spouse of a U.S. citizen or resident alien, you can elect to be treated as a U.S. resident in order to file a joint return. In this case, you can take the foreign earned income exclusion if otherwise
qualified.

Note: A nonresident alien is generally not subject to U.S. tax on compensation for services performed outside the United States. Thus, under the dual-status rules, nonresident aliens would not report their foreign earned income during the non-residency part of the tax
year.