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.