I just wanted to add my support for you OP. Please don't listen to the very, very few comments saying your behaviour is the problem here. It's not. If you went through his belongings every day, always screamed and shouted at him, took his phone to check it constantly then I could see where those people err coming from. But you don't from what you've told us - this was a one off checking of his bag based on a gut feeling due to his recent behaviour and history of cheating (presumably he displayed similar behaviour back then). You then calmly asked him about it and asked to see his phone - he made up a preposterous story about the test being a prank, then refused to show you his phone and walked out (presumably to give him a chance to delete everything rather than stay and talk to you - if he'd done nothing wrong he'd have wanted to understand why you thought that so he could reassure you). It was only after he came back and changed his story that you ended up yelling at him - I imagine by this point you were terrified because it was looking more & more like not only has he cheated on you, but it seems he has a reason to suspect he may have HIV, which in turn means you are at risk too. And he hasn't even had the balls to tell you that,
None of your behaviour was unreasonable, given the circumstances and history.
I'm afraid he isn't really redeeming himself at all, is he? The packing a bag and walking out this morning is because he doesn't want to talk to you about this - he wants time to come up with a story, and he couldn't come up with one overnight that might have been plausible so he's buying himself more time.
Good luck for getting tested yourself, I hope all comes back clear. It might be worth doing a full STI panel given you think he might have been cheating on you and having unprotected sex. Definitely speak to a solicitor - even if he doesn't have HIV he's shown you that he cannot be faithful to you, and that he is being selfish in taking risks that put you at risk. That to me is worse than the cheating.
I hope all comes back clear and that you get rid of him - you deserve better.