I'm sorry you're going through this, but I'm seeing it from your ex's side: it was you that ended it, you had threatened it a number of times before, and you may have appeared to have moved out - the staying with friends. It's also been him paying the rent, if I understand you correctly - you've done the admin, but his money?
If the flat is owned by YOUR friends, talk to them. If it's gone onto a periodic tenancy they only have to give 2 months notice I think - and as they're your friends, they may waive the deposit?
That could get messy if he refuses to go and they have to evict though. Probably better that you just move on.
You say you're devastated and he's your world: hold on to the fact you left him for a reason. He's not your world.
It's a kick in the teeth about the new gf, but it sounds like you two had been over a while. Again - you left him for a reason. Focus on that, and leave him to it.
I don't think it's realistic to expect him to move in with her, btw.
If you are sofa surfing and absolutely can't afford a deposit, speak to your local housing office about homelessness help.
Does he have any money? As he wants to stay in the flat, would he pay your deposit?
Even if you have some legal basis to have the tenancy transferred to your name, surely he has as much right as you to keep it? Get advice from CAB, or possibly Shelter?
Good luck - but focus on the practicalities, not him.