To qualify for the foreign earned income exclusion, the foreign housing exclusion, or the foreign housing deduction, your tax home must be in a foreign country throughout your period of bona fide residence or physical presence abroad.
Your tax home is the general area of your main place of business, employment, or post of duty, regardless of where you maintain your family home. Your tax home is the place where you are permanently or indefinitely engaged to work as an employee or self-employed individual. Having a tax home in a given location does not necessarily mean that the given location is your residence or domicile for tax purposes. If you do not have a regular or main place of business because of the nature of your work, your tax home may be the place where you regularly live.
As long as you have your habitation, residence, domicile, or place of dwelling which depend on where you maintain your economic, family, and personal ties ("abode") in the U.S. you are not considered to have a tax home in a foreign country. But if you are only temporarily in the U.S. your abode does not necessarily have to be in the U.S. Your abode is also not necessarily in the United States merely because you maintain a dwelling in the United States, whether or not your spouse or dependents use the dwelling.