"I'd like to allow him somewhere to live after I die."
That's very easy to do.
"But who pays for house maintenance?"
He would (presuming that you die before him)
"Does he pay DC rent?"
No.
.
"If I die young, he could live for 30 more years, so dc won't get any inheritance till he dies. Do I set a limit on how long he can stay?"
Yes, you certainly can. You can set a time limit (eg a certain number of years) or contingent on a specific event (eg cohabitation or remarriage) or simply for the rest of his life or until he goes into care.
.
"If I die old, dc won't want to kick an elderly man out of his home, but again, who pays maintenance?"
Your partner will. Your will will include a phrase saying that he is responsible for the payment of any outgoings such as insurance, repair, decoration etc.
.
"If, as a PP suggested, we buy together and become tenants in common, we can each leave our halves to our respective DC."
From this it appears that you are suggesting that you sell half of your house to your partner? Just be aware that if he takes on any part of the mortgage (and if you are transferring half of the house to him and there is a mortgage then your lender will likely require him to be added to the mortgage) then there will also be stamp duty to pay on the value that is transferred to him if it is above £125,000.
So, for example, if you have a mortgage of £200,000 and transfer 50% of the house to him then there is no stamp duty to pay as his share of the mortgage is less than the stamp duty limit of £125,000 (I presume that he does not own any other property otherwise he will have to pay 5% stamp duty regardless of the size of the mortgage).
"...we can each leave our halves to our respective DC."
Yes
"But then when one of us dies, the other has to sell the house to give the DC their inheritance."
No. It is typical in this situation that each spouse leaves their share of the property in trust to their children and gives the other spouse a "life interest". This means that they can stay in the property until they die and the trust prevents the children from kicking the surviving spouse out of the house.
Although this does have the downside that you mentioned above that the surviving partner may live for a long time afterwards. But it is always open to you to limit the amount of time (eg five years) instead of a life interest.
"Then how do you buy a house with half the proceeds and no income as likely be elderly and retired."
The 50% share of the house is left in trust to the children with a life interest for the surviving spouse to occupy the house for the rest of their life. So they can't be kicked out.
Most wills are written so that the surviving spouse can move house and/or downsize to a smaller house and the new house is held on the same basis.
.
"If one of us needs care, how could we sell our house to pay for it, as the other would also be forced to sell thier share. Where would they live then?"
This is one benefit of being married. If a person goes into care and there is a member of their family (eg spouse) over the age of 60 still living in the family home then the value of the home is totally disregarded for the purposes of deciding whether they have to pay for care.
So, if you were to marry and then one of you were to later go into care then the value of the home would be totally ignored as long as the other spouse was over 60 and still living there.
If, for example, your partner were to die first and you were then later to go into care the Local Authority would place a charge on your half of the home but no charge would be placed on his half of the home.