This is from Shelter's website:
"Notice
If you have a periodic tenancy (which means that the original fixed-term has ended and your tenancy runs from week to week or month to month), you have to give one month's notice in writing, or longer if you pay your rent less often. The notice should end on the first or last day of the period of a tenancy. Once the notice ends, your tenancy ends and you no longer have any right to live in your home.
If you have a fixed-term tenancy (ie for one year) you will only be able to give notice during the fixed-term if your tenancy agreement says it is allowed. The length of notice you have to give depends on what your tenancy agreement says.
It's possible to leave on the day your tenancy ends without giving any notice, but this is not usually advisable. It is best to give your landlord notice if you can, especially if you have paid a deposit and need it back."
It does not say whether a valid notice can be given by one tenant when the tenancy is joint but - like BM - I believe it can be. However, you can check this by ringing Shelter's Helpline.
Person 1 needs to make sure their notice to the landlord gives at least the necessary one month & terminates at the right time. He/she also needs to make absolutely sure that the landlord has received and accepted the notice.
The deposit should have been protected in a scheme & should be returned to the tenants unless needed by the landlord for justifiable costs connected with the tenancy. If person 2 does not leave & Court action is needed to evict him/her & rent remains unpaid then the costs will clearly exceed the amount of the deposit by a considerable figure. It could be that person 1 will be held liable for these costs as well as person 2 (because vacant possession has not been given at the end of the tenancy) but this would seem to conflict with person 1's ability to give notice unilaterally. Nonetheless, it would be worthwhile confirming the position with Shelter. If it all gets too complicated & the landlord demands significant sums from person 1 a housing law solicitor may be needed.