Deductions & credits

Okay, so in that case, if I were to move to Montana in 2023. In early 2024 when I file my taxes, would I complete one non-resident return for the income i earned in NC and one resident return for the time I lived in Montana, and then i would just pay the difference in whatever the taxes were?