I have two passport one is Saudi and the other is British.
My question is I am in Saudi Arabia and I want to travel to the UK and back how does that work?
And do I need a visa for any of the two counties?
Show your Saudi passport to the Saudi Immigration, show your British passport to UK immigration. If the airline asks if you have a Visa for the UK show them your UK passport.
Do not show Saudi Immigration your UK passport. As I understand you may get into trouble if you do.
I do this all the time and it's never been an issue for me. it used to be that you could get a certificate of right of abode in your Saudi passport that acted like a permanent visa meaning that you didn't need the UK passport, but they don't issue these any more.
There are usually multiple places where you'll have to show passports and things can get a bit tricky. Obviously you'll use the passport of the country whose passport you are at. But often you want to show the passport of the destination country at check in to show the airline company that you have the appropriate visas/residency.
So for example for a trip from Germany to the US the sequence is as follows:
You need a visa for neither country because you are a citizen of each.
When you enter a country, in order not to need a visa, you show them the passport of that country.
In your case, when arriving to Saudi Arabia, you show them the Saudi passport. When arriving to the UK, say after you get back, you show them the UK one. You obviously need to have both with you but you always show one at any given time.
It is possible there are legal exceptions, but this works in most parts of the world. For Saudi Arabia, which gives no visas to tourists, you pretty much have no choice.