It depends on how you are paid and who you are being paid by. If you are paid by a US source, then this is not foreign income even though you are on foreign soil. TO claim the exemption, you would need to be paid from a foreign source. Please refer to this IRS link for more details.