You meet the bona fide residence test if you are a bona fide resident of a foreign country or countries for an uninterrupted period that includes an entire tax year. An entire tax year is from January 1 through December 31 for taxpayers who file their income tax returns on a calendar year basis.
Once you have established bona fide residence in a foreign country for an uninterrupted period that includes an entire tax year, you will qualify as a bona fide resident for the period starting with the date you actually began the residence and ending with the date you abandon the foreign residence. You could qualify as a bona fide resident for an entire tax year plus parts of 1 or 2 other tax years.
Example: You were a bona fide resident of England from March 1, 2006, through September 14, 2008. On September 15, 2008, you returned to the United States. Since you were a bona fide resident of a foreign country for all of 2007, you also qualify as a bona fide resident from March 1, 2006, through the end of 2006 and from January 1, 2008, through September 14, 2008.
If you are a United States citizen with a tax home in a foreign country and you meet the bona fide residence test or physical presence test, you may exclude up to the maximum limit allowed for the taxable year.
The example above I took from the IRS Topic word-by-word.
To be eligible to claim the foreign earned income exclusion or the foreign housing exclusion, you must have a tax home in a foreign country and meet either the bona fide residence test or the physical presence test. The bona fide residence test is described above.
The physical presence test can be used by any United States citizen or resident alien. You must be physically present in a foreign country or countries for at least 330 full days during any period of 12 consecutive months. The 12-month period can begin with any day of any calendar month.
Based on your description you satisfy both tests and are eligible for excusion. The maximum annual exclusion is prorated on a daily basis if there is any part of the year that you do not qualify under either test.
I would also suggest to read the IRS publication 54 - http://www.irs.gov/pub/irs-pdf/p54.pdf
If the period for which you qualify for the foreign earned income exclusion includes only part of the year, you must adjust the maximum limit based on the number of qualifying days in the year. The number of qualifying days is the number of days in the year within the period on which you both:
For this purpose, you can count as qualifying days all days within a period of 12 consecutive months once you are physically present and have your tax home in a foreign country for 330 full days. To figure your maximum exclusion, multiply the maximum excludable amount for the year by the number of your qualifying days in the year, and then divide the result by the number of days in the year.
Example. You report your income on the calendar-year basis and you qualified for the foreign earned income exclusion under the bona fide residence test for 75 days in 2007. You can exclude a maximum of 75/365 of $85,700, or $17,610, of your foreign earned income for 2007. If you qualify under the bona fide residence test for all of 2008, you can exclude your foreign earned income up to the 2008 limit.