Dual state taxes

We lived in Massachusetts for most of the year. We have a home in South Carolina where we are now residents. This occurred on 9/30/2024. How do you figure how much each state gets. We need to file in SC so we will get a break on the real estate tax.