Before getting into details, check this.
If your state does *NOT* tax personal income, then bxes 15, 16 and 17 must be totally blank. Not even a space in any of those boxes. If your state does tax personal income, then all three of those boxes must have something in them. No exceptions.
If your local government or locale under the state does not tax personal income, then boxes 18, 19 and 20 must be blank. Not even s space. Likewise, if your locale does tax personal income, then all three boxes must have something in them. No exceptions.
If you were issued more than one physical W-2 by the same employer, and one of them only has data for boxes 15-17 and/or 18-20. then you enter the two W-2's "AS IF" all of that data was on one W-2. The program allows you to enter up to 10 states and 10 locales on a single W-2.