You first pay taxes to the state where you work based on the income earned in that state. You then calculate taxes on that income in the state where you live, and take a credit against that tax for the taxes paid to the state where you work. There is no double taxation but you are taxed at the higher of the rates between where you work and where you live.