I'll give it a go, but bear in mind this is an interested layperson's understanding!
In all scenarios, on first death all goes to spouse = no inheritance tax to pay at that point.
On the second death, because a house is being gifted to children (ie direct descendants), the enhanced threshold of £500 k applies. The whole allowance from the death of the first spouse is also transferred, meaning a inheritance tax-free amount of £1 million.
I'm pretty sure the whole calculation is done at the point of the second death, so scenarios 1 and 3 are essentially the same. The value of the estate at death is approx £1 million, equivalent to the tax-free threshold, thus tax is only payable on the amount that exceeds £1 million. (If there are any charitable gifts in the will, their value can be discounted from the total for IHT purposes also)
Scenario 2, the gift is less than 7 years before death so the value of the estate for IHT is £1.5 million. This leaves approx £500 k taxable,
at 40% means IHT to pay of £200k.
A further variation on scenario 2 is if the second spouse dies between 3 and less than 7 years after the gift. The amount of the gift, £500k, is considered first against the IHT free allowance. That leaves a further £500k allowance against the £1million remaining value of the estate. So IHT is also payable on £500k in this situation, right up until 7 years have passed since the gift at which point no/minimal tax will be payable. That is a point I only came to appreciate recently!
You may read about IHT taper rates. They only come into play if the amount gifted within 7 years or less of death is more than the relevant IHT free allowance, and reduce the tax payable by an increasing proportion over time. I realise that I am not sure if this impacts scenario 1, where possibly £250k may be attributed to spouse 1 and counted against their IHT allowance available to be transferred to spouse 2. I have a feeling this may not be the case but would appreciate an expert expressing an opinion here!
For these calculations it is relevant that the total £1 million + ~£500k is less than £2 million above which the extra allowance goes (don't know if all at once or tapered).
I have also - and this is important! - assumed this is one large gift over and above the various allowances for small gifts per year, regular giving out of surplus income, and larger gifts on marriage.
I hope this helps a little, having noted that no-one else has had a go yet :) My knowledge is based mainly on reading, interest stemming from helping an elderly long-term non-resident, with significant overseas assets, plan their return to the UK.