You have to treat one of the states as a non-resident state.
....usually, the middle state...but it really depends on exactly how long you were in each state, and where you worked during each stay. The exact details of each stay...and what state you actually worked in, point-in-time, become critical.
______________
Of course, if it gets messy, sometimes you just go to a local tax pro to prepare and file for 2022.
@multistateglad Using TurboTax CD/Download software, you can e-file returns for up to three different states for each federal return you prepare. For more information, please visit the help article below.
How many state returns can I prepare in the TurboTax CD ... - Intuit
Using TurboTax Online, you can prepare and e-file up to five state returns per federal tax return. For more information, please visit the help article below.
How many state returns can I prepare in TurboTax Online? (intuit.com)