This might apply, you would need to very carefully read the requirements to determine how the days are counted, it is not a simple determination of what is considered physically present in a foreign country.
Who qualifies for the foreign earned income exclusion?
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.
***************************************************************************************