My wife and I moved from Massachussetts and bought a house at about the same time I was starting school. I wasnt even going to apply for residency for the first semester but someone told me I should try. I applied 2-3 weeks into the semester and surprisingly was granted residency. My wife works in Jersey so I dont think you have to live here a year before applying nor does your spouse have to work in Pennsylvania unless the rules have changed. Although my wifes family does live nearby in Jersey so maybe that helped me gain residency.
On the other hand, my buddy bought a condo at the end of his freshman year and was not granted residency. I asked him what happened. He said they dont consider buying a condo the same as a house. Maybe a condo doesnt seem as permanent.
Anyway, thats my experience.