This question is trickier than it might seem. In modern times, professionals like physicians and attorneys must pass examinations and receive some kind of certification. Traditional gurus, however, follow no such conventions. Other standards must be applied. Appearance is certainly not one of those standards. A long beard and orange robes does not make one a guru
In a famous passage from the Mundaka Upanishad, the sage Angiras defines two basic requirements for a guru when he says, "Seek a guru who is a shrotriya, one who knows the scriptures, and who is brahma-nishtha, firmly established in truth." Our scriptures, like the Bhagavad Gita and Upanishads, contain the guidance necessary to lead us toward the goal of the journey of spiritual growth. These scriptures could be compared to a road map because they show us where the goal lies as well as the route to be followed. Obviously, a teacher who would offer us spiritual guidance should know those scriptures fully. And since even the best nslations are far from perfect, the teacher should understand the Sanskrit language of the scriptures.
But mere scriptural knowledge is not enough. Possession of a road map is not the same as having already traveled the route to the goal. Therefore, in addition to knowing the scriptures, the ideal teacher should also be brahma-nishtha, established in the truth of brahman, the true reality. That is, the ideal teacher is one who is enlightened, who has gained moksha, freedom from bondage. One who has already reached the goal will obviously be the best guide.
Of course, not all spiritual teachers possess these lofty requirements. Practically speaking, gurus like Angiras described are rare indeed. So, we must choose the best teachers available. Such teachers may be called upagurus, teachers that can lead us further, but not necessarily all the way to the goal. Sometimes, many such upagurus are necessary along the path in one's life-long journey of spiritual growth.