It's certainly possible but you need to get some professional legal advice.
If you take over the mortgage in your sole name instead of you and your DHs joint names, you need to agree what equity there currently is in the house, and how this should be split.
In a divorce in the UK, the starting point is 50:50, but this can change depending on the personal circumstances of each party (eg long marriage with children and SAHM, mum might get bigger % in lieu of maintenance).
However, you are only staying in the house to give stability/continuity to youngest DC.
There could be a recession and house prices could fall, so if you had agreed a £ amount to split, you would lose out .
I would suggest you agree a current valuation for the house, which would show x amount of equity, which would be split between you in y and z amounts.
But make provision that when the house is actually sold that the % split is applied to the actual £ equity realised IF THE VALUE HAS DECREASED.
If it has increased, the original agreed figures should be used because your sole mortgage payments have brought about that increase. Effectively he 'sold it' at that price, and should not benefit from any further increase.
It's not unusual for this scenario to happen, but you need to have a legal watertight agreement.
A close friend is in a similar situation, and it has caused her so many problems.
I think it's worth just selling the house, clean break, move on.