As a US citizen, you’re taxed on your worldwide income. That includes income you earn working in a foreign country.
To reduce the double taxation that can result when the foreign country where you work can also tax that income, and to create a more equitable economic playing field for companies that pay US workers overseas, section 911 of the Internal Revenue Code provides a limited exclusion for foreign earned income.
To qualify for the exclusion, you must have a tax home in a foreign country and satisfy either the bona fide residence test or the physical presence test.
While the two tests are fairly straightforward, the terms “tax home” and “foreign country” are not clearly defined in the tax code. The ambiguity leads to tax court disputes (see the Taxing Lessons newsletter archives for recent cases), and frivolous tax arguments asserting that US states, Commonwealths, and territories of the US are foreign countries (see Treasury Regulation § 1.911-2(g) & (h)).