Inheritance Tax is a GIFT tax not a DEATH tax. Most people can use their full Nil Rate Band (NRB) to gift money in life i.e. a Lifetime Gift, outside of their estate without an immediate inheritance tax liability saving 40%.
If you use up your NRB with gifts, when gifting in excess of the NRB, if you make further gifts to family or friends it is still a potentially exempt transfer (PET) and you must survive for 7 years for all gifts to be inheritance tax free BUT if you make further gifts to a company or discretionary trust, it is not a PET and becomes a chargeable lifetime event with a reduced inheritance tax bill payable immediately of 20% and a further 20% if you die within 7 years.
If your spouse dies and they did not use up there NRB, this is then transferred to the surviving spouse. The transferable nil rate band (TRNB) cannot be used for 'lifetime' gifting by the surviving spouse but is only available on death.
In the same way, the additional Residence Nil Rate Band for homeowners (RNRB) only applies when gifting property on death only, to children, grandchildren, step children, foster children etc. IT ALSO CANNOT BE USED FOR LIFETIME GIFTS.