Deductions & credits

I see, thank you for the replies. At first glance it seems like it might be easier if I were a MA resident since while going to school in PA I also worked there and had my residence as being in MA (this finished before selling the MA residence) so my W2 has tax withheld for MA. Is being a dependent necessary for considering the MA residence as my permanent residence? As far as documents like drivers license and things go that is where I lived. Then for the time between selling the MA residence and moving to VA I stayed in my parents MA apartment.