Per the IRS, all
Medicare Parts (including Medicare Part B) are insurance that constitutes
medical care under section 162(l). Please see this IRS link, page 1, http://www.irs.gov/pub/irs-wd/1228037.pdf
If you are
a more-than-2% shareholder in an S corporation, the policy can be either in
your name or in the name of the S corporation. You can either pay the premiums
yourself or the S corporation can pay them and report them as wages. If the policy
is in your name and you pay the premiums yourself, the S corporation must
reimburse you.
You can deduct the
premiums only if the S corporation reports the premiums paid or reimbursed as
wages in box 1 of your Form W-2 (this would include your salary + health insurance premiums paid) in 2016. Therefore the health insurance portion will not be included in Boxes 3 and 5 because it is not subject to social security & medicare taxes. So this amount (box 1 of your Form W-2) would be reported on Line 7 Compensation of your Form 1120S.
Then this same amount from Box 1 of your Form W-2 will be reported on your Form 1040, on line 7. At this point, you will be able to take the "above the line" or adjustment to Income which is Line 29 Self Employed Health Insurance Deduction. This amount would be your health insurance premiums portion.
Please see this IRS
link, page 32, Self-Employed Health Insurance Deduction: http://www.irs.gov/pub/irs-pdf/i1040gi.pdf