Do I have to meet the 330-day presence test or have a valid working
resident visa to meet the requirement for foreign income exclusion?
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 a U.S. 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 (must/should) comply with the other country's
laws.