State tax filing

Thank you for the answer. 

Here is an example of our situation : my wife and I both lived in Texas from 01/01/2022 to 06/22/2022. Then I moved to Indiana and she moved to Massachusetts.  In order to not have more than 365 days in total, I either have to get rid of my residence in Indiana or her residence in Massachusetts. Is this okay?

Thank you for your help!