Verse 2.136 of the Manusmriti names five grounds of respect: wealth, kin, age, deeds and learning. In one modern translation, “each succeeding factor is weightier.”
Verse 2.156 says: Na tena vriddho bhavati yenasya palitam shirah. “One does not become old merely because one’s head is gray. Rather, he who, though young, is learned in scriptures, him the gods consider to be an elder.”