Not qualified to comment on the “deductions for working out of state” per se - what may or may not be a deductible business expense etc.
However, there are tax credits for taxes you pay to another state, when you’re doing your home state tax return. If you are required to pay taxes to the other state - which is likely unless they have a reciprocity agreement with yours - you will need to file in both (all 3 in your case?) locations. For the other states, you file a nonresident return and pay tax on only the income earned there.
The following is from my memory of when I worked in Manhattan for 2 years, while living in another state. I’m sure there are a LOT of nuances I’m leaving out.
As a simplified example, you earn 10,000 a month and your in-state tax rate is 5% (or 500 a month). Your total income tax for your home state would be 6,000.
If you work in state A for a month, with a tax rate of 8% (800 dollars) and state B for a month with a tax rate of 3% (300 dollars), you file a nonresident return with each, paying those figures.
Then you file your home state return. 120,000 income. Total tax bill, 6,000. You get credits for what you paid to state A - up to the amount you’d have paid your home state (i.e., 500 dollars). And you get credits for what you paid to state B - up to the amount you’d have paid your home state - but you paid them less, so you only get a credit for 300 dollars; you still have to remit the 200 dollars to your home state.
So your net tax bill is 6,000, plus 800 (state A), plus 300 (state B), minus 500 (credit for tax paid to A), minus 300 (credit for tax paid to B). Or, a total of 6,300 dollars.
When I was in that position, I screwed up the credit calculation. Gave myself credit for 800 dollars instead of 500 dollars. Got a letter 2 years later from my home state, saying “pony up!!”. Oops. I’d already file for the prior year so as expected I got another letter a few months later.