From CAB:
Housing
Tenants
As a tenant, your rights will depend largely on your tenancy status. If you are not sure what this is, in England and Wales see Renting from a private landlord or Renting from a social housing landlord.
Living together
If you are the unmarried partner of a tenant, whether in private or social housing accommodation, you will usually have no rights to stay in the accommodation if the tenant asks you to leave. It is therefore advisable for partners who are living together to be joint tenants, as this gives them equal rights and responsibilities. Many social housing landlords will require partners who live together to take on a tenancy as joint tenants. It is possible to convert existing sole tenancies to joint tenancies if the sole tenant and the landlord agree.
However, as an unmarried partner, you can get short-term rights to stay if you apply to court. A court can also transfer a tenancy, whether it is a sole or joint tenancy.
You may also have different rights if your partner has been violent towards you.
If your partner has been violent towards you, see Domestic violence.
If you are an unmarried partner who is not a tenant and need to stay in the home, you should consult an experienced adviser, for example, a family law solicitor. A Citizens Advice Bureau will also be able to give details of local solicitors. To search for details of your nearest CAB, including those that can give advice by CAB
If a sole tenant dies, a surviving partner may have the right to continue living in the home. If you are in this situation, you should seek legal advice.
Marriage
Both married partners have the right to live in the matrimonial home. It does not matter in whose name the tenancy agreement was made. This applies unless a court has ordered otherwise, for example, in the course of separation or divorce proceedings.
If you and your ex-partner both agree on who should stay in the home, you can ask the landlord to transfer the tenancy into the name of the partner who is staying. If both names are on the tenancy, you can ask for one of the names to be taken off.
If you can't agree on who should stay and you are divorcing, the long-term right to your tenancy can be decided during divorce proceedings. The court can transfer the tenancy to your name, even if your partner is the sole tenant, or you and your partner were joint tenants. However, if you are not separating legally, for example, divorcing, the court will only agree to transfer a tenancy if it decides it is in the best interests of your children.
If you want to apply to transfer a tenancy, you should do this at the same time that you apply for a divorce. If you don't do this, it may not be possible for the tenancy to be transferred at a later date.