If the two start talking at the same time
Do not add your voice to the two already talking. Instead, raise both your hands, each one with the palm towards the two friends, and say something like
Hey hey hey, I've got two ears but only one brain. Only one person speaking, please.
Then you look at them and leave the task of deciding talking turns to them. Like this you don't favor a friend over another, you're just stating that this kind of communication is ineffective. It's up to them, now, to choose which one is going to talk, and, since it's their agreement, it's likely that they are going to respect it.
If one of them is talking and another follows
Now this is different. The second friend is being rude, so you can interrupt him and point out that the first one was talking -- he can resume telling his story afterwards. Just do not make a mountain out of a molehill: be short and do not rant about you friend's habit of talking over other people.
Often, the difference between a rude sentence and a firm one lies in the nonverbal. To convey that you're not angry or think ill of the second friend, do not frown, do not raise your voice (or, if you have to do it to be heard, soften it as soon as a loud voice is not needed anymore), look at your friend in the eyes.