State tax filing

Thanks for the response. For better clarification, let me use the following example.

 

Let's say I bought some stocks when I was in Indiana and I sold them when I was in Illinois. Let us say I moved to IL on 1st Sept 2021 and the following are the buying dates, selling dates, and gain on the stock:

  1. Bought on 1st March 2021, Sold on 1st December 2021, and gained $90. So I had this stock for 9 months: 6 months in Indiana and 3 months in IL. Will I pay tax on $60 to IN and $30 to IL?
  2. Bought on 1st September 2020, Sold on 1st December 2021, and gained $150. So I had this stock for 15 months: 12 months in Indiana (4 months of 2020 and 8 months of 2021) and 3 months in IL of 2021. Will I pay tax on $120 to IN and $30 to IL? And by this logic, $40 is the tax of the previous (4 months of 2020) year. Right?

 

Please feel free to ask for clarification.