AFAIK it is legal to leave your house to (eg) your children with the surviving spouse having a life interest in it, meaning that they can live there as if it belongs to them, but they have no financial interest in the property. If they die before going into care, the situation is as it would have been if the children had inherited in the 'normal' way, but if they are unlucky enough to need care, the house is not included in their assets to pay for it.
The morality of this is controversial. Some see it as deprivation of assets, but others see it as equalising a system where those who have deprived themselves of equivalent assets (ie earnings that have already been taxed) as they went through life, by having expensive holidays, cars and other costly lifestyle choices, and who are subsidised by people who have done without those things and saved or bought a house instead*.
A possible downside, however, is that with no house to sell if you do need care, you will be at the mercy of the LA, which may give you very limited choices when it comes to choosing a home.
*The fact that this is a very unequal country, and that many people work hard but have neither property, savings nor a lifetime of memories and holiday snaps is (IMO) very wrong, but is a separate issue.