Sold my house in NY in Aug 2022 and purchased new house in NJ in August 2022

Hello, I sold my NY house in Aug 2022 and purchased a house in NJ in Aug 2022. I lived in NY from 1/1/22 to 8/12/22 and in NJ from 8/13/22 to 12/31/22. I have worked in NJ for the last 31 years. What state forms do I need to file for tax year 2022?