Deductions & credits

Ok ... so you think because you can exclude all the foreign income then NONE of the cap gains should be  taxable  but that is NOT how it works.   Review the cap gains worksheet in the PDF of the return to see how the tax is calculated correctly by the program ... the excluded income is added back for the tax calculation purposes per the IRS rules.