PHYSICHAL PRESENCE TEST
You meet the physical presence test if you are physically present in a foreign country or countries 330 full days during a period of 12 consecutive months. However, those 330 days do not have to be consecutive. The physical presence test is based only on how long you stay in a foreign country or countries. This test does not depend on the kind of residence you establish, your intentions about returning, or the nature and purpose of your stay abroad.
Any U.S. citizen or resident alien can use the physical presence test to qualify for the exclusions and the deduction.
You work in New Zealand for a 20-month period from January 1, 2014, through August 31, 2015, except that you spend 28 days in February 2014 and 28 days in February 2015 on vacation in the United States. You are present in New Zealand 330 full days during each of the following two 12-month periods: January 1, 2014 - December 31, 2015, and September 1, 2014 - August 31, 2015. By overlapping the 12-month periods in this way, you meet the physical presence test for the whole 20-month period.
More information can be found in the IRS Publication 54.