I am looking for some advice on the below senario... this is all new to me!

My best friend is African (non eea - husband) married a lovely British girl in 2010 who was living in UK when they met (eea - wife.) He moved to the UK in 2014 on a spouse visa. Their marriage has always complicated and recently failing, now he has had / having an affair. Idiot.
He is likely to leave within the next few days and is worrying about his visa status and staying on the right side of the law.
What happens to his status if he leaves?
If he divorces can he apply for ROR ?
Is this likely to be granted if he has all paperwork etc I order ? He is self employed but not 'skilled'
He is trying to make up for the sake of his visa only but he can't be sure his wife or her family won't complain to immigration he used her a passport? If she does I imagine he could be in real trouble!
Any advice welcome

Thanks in advance