You might want to check out IRS publication 54, which has information about taxpayers working abroad:
http://www.irs.gov/publications/p54/ar02.html
[highlights]
1) I qualify for the foreign earned income exclusion and earned more than $80,000 during the year. Am I entitled to the maximum $80,000 exclusion?
Not necessarily. Although you qualify for the foreign earned income exclusion, you may not have met either the bona fide residence test or the physical presence test for your entire tax year. If you did not meet either of these tests for your entire tax year, you must prorate the $80,000 maximum exclusion based on the number of days that you did meet either test during the year.
2) How do I qualify for the foreign earned income exclusion?
To be eligible, you must have a tax home in a foreign country and be a U.S. citizen or resident alien. You must be either a bona fide resident of a foreign country or countries for an uninterrupted period that includes an entire tax year, or you must be physically present in a foreign country or countries for at least 330 full days during any period of 12 consecutive months. U.S. citizens may qualify under either test. The physical presence test applies to all resident aliens, while the bona fide residence test applies to resident aliens who are citizens or nationals of a country with which the United States has an income tax treaty in effect.
Your tax home must be in the foreign country or countries throughout your period of residence or presence. For this purpose, your period of physical presence is the 330 full days during which you are present in a foreign country, not the 12 consecutive months during which those days occur.