The past continuous subjunctive can be used in the if-clause of a sentence in the second conditional to express an unreal action in the present which is imagined as continuous:
The past perfect continuous subjunctive can be used in the if-clause of a sentence in the third conditional to express an unreal action in the past which is imagined as continuous:
if + past subjunctive | would + infinitive (simple or continuous)
The second conditional can describe an unreal situation with reference to the present. We imagine a hypothetical situation which contrasts with reality: