The country where the accused person was arrested would extradite that person to one of the countries where the crimes had been committed. The extradition treaties or the law of the arresting country might have a rule to define how to choose which country took precedence. (Perhaps the earlier crime, or the more serious crime if they were different, or the closer ally might get priority.)
Once the accused was extradited, s/he would be tried, and if convicted, sentenced. Once the sentence was completed, that person would be turned over to the second country for trial and possible sentence there.
Sometimes, particularly if the sentence is long, an accused will be turned over to the second country for trial soon after conviction in the first country, under an agreement that the person would be returned to serve the sentence in the first country after the trial was over, whatever the outcome, and then sent back to the second country to serve any sentence imposed there. Or the second country could choose to count time served in the first country against its sentence, but I believe that this is not usual.
Consider the case of Frank Abagnale who was sought by some 12 different countries when he was arrested in France. He was convicted and served time in France, then extradited to Sweden, where he was also tried, convicted and served time. Italy had requested his extradition, but he was deported to the US, where he was also tried, convicted, and served time.