Same job but moved to parents house during pandemic

I worked the same job during all of 2020 and had $60k of income. I lived in the state where I worked for 4 months then I moved home to another state during the pandemic and worked remotely for 8 months. Do I have to pay taxes in both states or just the state where my job is and I lived for 4 months.