I looked up in Reliance of a Traveller. In it there is a list given in which the order of preference of the Imam is mentioned. -The first is the one with most Sacred knowledge then the one who memorized the Quran the most and so on. -Also its mentioned a non-traveler is prefered to a traveller even if the traveller has more knowledge is Sacred Law and -also the regular imam has more right to lead the prayer, - but he can assign anyone else to lead the prayer. I have quoted it below: "The imam assigned to a mosque or a person living in the house where the prayer takes place, even if only renting, takes precedence over everyone on the list, from the most learned on down, though he may select anyone else he wishes to lead the prayer. The sultan and those under him, of Islamic judges, regional governors, and so on, take precedence over even the imam of the mosque, the householder, and others."