How to file taxes jointly while working in different states and having home in both?

For a part of this year, my spouse and I worked in different states (CT & FL). We have different residencies and apartments in those states and share our time between the two places. How should we file jointly as a married couple in this case? From what I know, the filing status needs to be the same for federal and state taxes.