The IRS instructions for completing Form W-4 to calculate your allowances does not account for all possible situations. See the IRS information below relating to withholding.
Per IRS Publication 505 Tax Withholding and Estimated Tax:
Getting the Right Amount of Tax Withheld
In most situations, the tax withheld from your pay will be close to the tax you figure on your return if you follow these two rules.
But because the worksheets and withholding methods don’t account for all possible situations, you may not be getting the right amount withheld. This is most likely to happen in the following situations.
If you do not have enough tax withheld, you may have to pay estimated tax. See chapter 2 of Publication 505 for additional information about estimated tax payments.