It depends. The few states that have no income tax, obviously, won't tax your income.
Most states with an income tax will try to tax your income if it originates in their state. From personal experience as someone who has lived in Washington State (no income tax) and worked in Oregon (income tax up the wazoo), if the work is done "in Oregon" you are taxed.
But, and this was especially true during the pandemic and everyone working remotely, if you're not in the state, and the employer isn't based in Oregon (i.e., headquartered out east somewhere), and you don't reside in Oregon, you don't owe Oregon tax for any work not done in the state. Most employers will deduct taxes for Oregon as if you worked there all year. Just keep a spreadsheet full of days worked vs not worked in Oregon, and fill in the right box on the OR-40-N. They'll send you a letter asking for a signed letterhead from your employer supporting your math, so, if you're no longer with that employer, get that before you quit / part ways.