To qualify for the permanent resident exemption, you need to be a legal resident of said country for one whole tax year Jan-Dec. Just being a resident does not qualify you if it is not one entire tax year of residency. Otherwise it is the 330 day exemption. Now this part can get iffy-if you don't qualify for either this year, perhaps you qualify for the State Department's default perdiem for the amount of time you are out of the US.