I lived in DC but worked in MD for the tax year. How do I know if taxes were taken out by both MD and DC? My W2 has multiple boxes (Box 15) w/ TOTAL STATE, MD, and DC.

I lived in MD the previous tax years, but moved to DC at the beginning of the most recent. I maintained a job at the same company throughout. After the move, I forgot to fill out an MW507 form. Listed on one page of my W2 is TOTAL STATE and MD income tax. Listed on the second page of my W2 is DC income tax. Was I taxed in both MD and DC? Do I need to file for taxes for both?