live in md 7 months and 5 in DC yr 2023

Could you please help me :

I lived in Md from Jan-Jul and moved to DC in Aug-Dec 31, 2023.

Do I need to file 2 part time resident ?

I worked in DC but while resident of MD but they took DC taxes. 

The other company took DC taxes and lived in DC

The third compay took MD taxes while in MD .

I owe to DC and MD has to refund .

Do I need to file 2 different states and get and pay the money showed in my summary reports for each state or can I transfer the money owe to my refund state since they are reciprocal  states

 

Thank you so much