NUA stock sale should not be included in Net Investment Income tax calculation. How do I exclude it?

Sale of NUA stock transferred from 401K should not be included in Net Investment Income tax calculation (that is, Form 8960).  How do I correctly exclude it?  Is there an indicator in Schedule D or Form 8949 to mark a stock sale as excluded?