Please follow https://www.irs.gov/Individuals/International-Taxpayers/Foreign-Earned-Income-Exclusion.