If+Past perfect / would+Have+Past participle
If the ship had had enough lifeboats nobody would have died.
Used the third conditional to speculate about something that happened in the past and how it could have been different.
Facts: There weren't enough lifeboats. Many people died.
Speculation 1: if there had been enough lifeboats, nobody would have died.
Speculation 2: if the coastguards had known the ship was sinking, it would have been rescued.
You can't use "would have" after "if"
Ex: If he had seen her... NOT: If he would have seen her
You can use "could/might" instead of "would" (less likely)
Ex: If the coastguards had known the ship was sinking, they could have rescued everybody.