For the 2016 tax year, you would file a Puerto Rico tax return and, if you had US federally taxable income, a US federal tax return. Since you didn't live in PA during 2016, no state return is filed.
For the upcoming 2017 tax year, with respect to the federal income tax return the IRS states:
"U.S. citizens and resident aliens who aren't bona fide residents of Puerto Rico during the entire tax year are required to report all income from worldwide sources on their U.S. income tax return. However, a U.S. citizen who changes residence from Puerto Rico to the United States, and who was a bona fide resident of Puerto Rico for a period of at least two years before changing residency, can exclude any Puerto Rican source income from his or her U.S. income tax return attributable to the time he or she was still residing in Puerto Rico for part of the year."
For 2017 Pennsylvania taxes, you would file as a part year resident of PA. You would likely need to file a Puerto Rico tax return as well, though only in the income earned in and from Puerto Rico.
IRS tax publication 570 "https://www.irs.gov/pub/irs-pdf/p570.pdf" goes into the finer points.