Welcome to Just Answers! Thank you for giving me the opportunity to assist you! I will do my best to help! This is actually an area that I specialize in! I have been working with US expatriates working abroad for over 26 years.
I am assuming that you are already there? Unless you work for the US Government or the Armed Forces (they are not eligible for the Exclusion) you can qualify for the Foreign Earned Income Exclusion under §911 if you remain in the country for 330 days in a 365 day moving period, beginning with day you arrive. If there are 330 days in that period, you qualify under the Physical Presence test. It is, as I said, a moving window. You start counting your first day (midnight to midnight) and look for 330 foreign days. Once you hit that, you met the test.
For example, let's say you arrived in country on October 5, 2013 at 5:00pm. October 6, 2013 is your first foreign day. You remain in Afghanistan until April 1, 2014, then leave for the US for 10 days. You then return to Afghanistan on April 11, 2014. You remain in Afghanistan until November 2014. You would have 177 days between your arrival in October and your departure in April (April 1, your departure date, is NOT a foreign date, since you won't have 24 hours in country). You return April 11, 2014 which is considered a US day as well, since you were not there the full 24 hours. So your 330th foreign day would be September 11, 2014. Since that is before October 5, 2014, the 365th day, you qualify under the Physical Presence test. Furthermore, since you qualify early, you can use the "extra" days that you are allowed to spend in the US to back up your start date! For purposes of the test, your test year in my example would be September 12, 2013 to September 11, 2014. This would give you a prorated Exclusion of 110/365 days, even though you were only in country 86 days. The extra 24 days are the "unused" days that you were allowed to be in the US.
If you do not have 330 days (i.e., you had too many trips back to the US or its possessions) you can still qualify under the Bona Fide residence test if you are living in the foreign country on January 1 and December 31 of the same tax year. So, you won't make it for 2013, but if you stay until December 31 of 2014, you can still make it, and once established, it is retroactive to the day you arrive. So, if your work ends in late November or early December 2014, it may be worthwhile to stay there a few extra weeks to qualify!
Even if you don't qualify, the Afghan tax that you pay on your wages can be used to offset the US income tax on those earnings.
I hope this answers your questions! If you have any more, please feel free to ask, as this is my specialty! If you have found my answer helpful, please rate me highly. I would appreciate it!
Again, thanks! Have a great week!