330 days is physical presence test. There is another test called bona fide
residence test.
Bona Fide Resident For Part Of A Year
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, 2011, through
September 14, 2013. On September 15, 2013, you returned to the United States
. Since you were a bona fide resident of a foreign country for all of 2012,
you also qualify as a bona fide resident from March 1, 2011, through the end
of 2011 and from January 1, 2013, through September 14, 2013.