Crate a column in your cart for taxable items, for examples sake lets call it "taxable"
in the add to cart button behavior, set the taxable column to 1 for taxable items and 0 for none taxable items.
When creating the tax rule, for the calculation use "Based on Items with a Specific Value":
Total of [TotalPrice] where [taxable] has a value of [1] [times] [<your tax rate>]