According to Pub. 54:

"Foreign earned income generally is income you receive for services you perform during a period in which you meet both of the following requirements.
Your tax home is in a foreign country.
You meet either the bona fide residence test or the physical presence test."

A client...