The third conditional

We form the third conditional by using the past perfect after 'if' and then 'would have' and the past participle in the main clause:

if + past perfect, ...would + have + past participle

It talks about the past. It's used to describe a situation that didn't happen, and to imagine the result of this situation.