perfect subjunctive is formed from the perfect stem (3rd principal part with -i removed). To that stem, add -eri- and the “m” series of personal endings (-m, -s, -t, -mus, -tis, -nt)
Note that perfect subjunctive and future perfect indicative are nearly identical save 1st person singular, where future perfect indicative is -ero and perfect subjunctive is -erim.
Exempli gratia:
I have loved = (indicative) amāvī > (subjunctive) amāverim
you (s) have loved = (indicative) amāvistī > (subjunctive) amāveris
he/she/it has loved = (indicative) amāvit > (subjunctive) amāverit
we have loved = (indicative) amāvimus > (subjunctive) amāverimus
you (pl) have loved = (indicative) amāvistis > (subjunctive) amāveritis
they have loved = (indicative) amāvērunt > (subjunctive) amāverint
In the passive voice, the perfect tense of the subjunctive mood is formed simply by replacing the present indicative of sum (sum, es, est, sumus, estis, sunt) with the subjunctive equivalent (sim, sis, sit, simus, sitis, sint). All the old rules still apply for perfect tense passives:
Passive verbs in the perfective tenses (perfect, pluperfect) of the subjunctive are formed by combining the perfect passive participle from the 4th principal part with one of the subjunctive imperfective tenses (present, imperfect) of sum.
Perfect passive subjunctive = 4th p.p. + present subjunctive of sum (sim, etc.)
Pluperfect passive subjunctive = 4th p.p. + imperfect subjunctive of sum (essem, etc.)
Since the 4th p.p. is being used as a participle, it has to agree with the subject in case, number, and gender (using 1st/2nd declension endings).
Case is, of course, nominative (because subjects are nominative)
If your subject is singular, both the participle (per adjective rules) and the form of sum (per verb rules) is singular; vice versa with plural.
You need to know the gender of the subject in order to pick the gender of the participle. If it is impossible to know, make an educated guess.
Exempli gratia:
I have been loved = (indicative) amātus sum > (subjunctive) amātus sim
you (s) have been loved = (indicative) amātus es > (subjunctive) amātus sis
he has been loved = (indicative) amātus est > (subjunctive) amātus sit
we have been loved = (indicative) amātī sumus > (subjunctive) amātī simus
you (pl) have been loved = (indicative) amātī estis > (subjunctive) amātī sitis
they have been loved = (indicative) amātī sunt > (subjunctive) amātī sint