The Gemara records a tannaitic dispute about whether the phrase 'מִפְּנֵי שֵׂיבָה תָּקוּם' obligates standing before any gray-haired person or only before a Torah scholar: the baraita in Kiddushin 32b initially limits the obligation to a sage, since 'elder' (זקן) denotes wisdom, while Isi ben Yehuda there reads 'before the hoary head you shall stand' to include anyone of hoary head — and Kiddushin 33a records that Rabbi Yohanan ruled the halakha follows Isi ben Yehuda, even himself standing before non-Jewish elders in recognition of what they had experienced.
The Rambam codifies the broader position, ruling in Mishneh Torah, Torah Study 6:9 that one who is exceptionally advanced in age must be stood before even if he is not a scholar, and that even a Gentile elder receives honor in words and a steadying hand, since 'מִפְּנֵי שֵׂיבָה תָּקוּם' implies any hoary head; similarly, Mishneh Torah, Torah Study 6:1 grounds the core obligation to honor a Torah scholar in the same pasuk, parsing 'elder' as one who has acquired wisdom.
Shulchan Arukh, Yoreh De'ah 244:1–11 rules that it is a positive commandment to stand before a sage even if young, and likewise a mitzvah to stand before one aged seventy even if an ignoramus — with even a scholar who is young standing before an exceptionally aged elder, though only a partial rise is required for the elder's honor rather than a full rise; Arukh HaShulchan, Yoreh De'ah 244:9 similarly rules that all others besides a young scholar are obligated to stand fully before an aged elder, just as before a sage.
Arukh HaShulchan, Yoreh De'ah 244:1–13 distinguishes the two terms in the pasuk, reading 'שיבה' according to its plain sense as referring to one who has reached seventy years — even without Torah scholarship — while 'זקן' denotes one who has acquired wisdom, and he holds that at minimum even 'שיבה' requires that the person not be wicked.
Sefer HaChinukh 257:2 explains the rationale for honoring a non-scholarly elder: through his many years he has seen and understood something of God's works and wonders, and is therefore deserving of honor, citing Rabbi Yohanan's ruling in Kiddushin that the halakha follows Isi ben Yehuda — subject to the condition found elsewhere that the elder not be a transgressor, since such a person has forfeited his claim to honor.
Sefer Charedim, Positive Commandments 6:4 records that one must rise fully before an elder even if he is not a scholar, as derived from 'מִפְּנֵי שֵׂיבָה תָּקוּם,' and discusses various interpretations of 'אשמאי' — whether it means a Gentile, an Israelite sinner, or an ignoramus — noting that Tosafot and the Smag read the doubling of 'תָּקוּם' to obligate rising both before and after an elder.
Minchat Chinukh 257:3 notes that the Rambam and Sefer HaChinukh leave the age threshold for 'שיבה' unspecified, while the Shulchan Arukh and Tur in the name of the Rosh set it at seventy years based on the Mishnah in Avot, though the Targum's rendering might point to sixty as the threshold for 'זקן.'
אבן עזרא, ויקרא יט לב reads 'מִפְּנֵי שֵׂיבָה' broadly as referring to any old and gray-haired man, and understands 'וְיָרֵאתָ' as a warning that God will punish one who fails to honor elders in his own old age.
Sefer Chasidim 579 underscores the seriousness of honoring an elder by invoking the verse 'נֶגֶד זְקֵנָיו כָּבוֹד' (Yeshayahu 24:23), and illustrates that even in a situation of competing obligations the dignity of the elder must not be weakened.
Kiddushin 33b records the teaching of Rabbi Shimon ben Elazar that an elder must not burden others to honor him, derived from the juxtaposition of 'זָקֵן' and 'וְיָרֵאתָ' — indicating that the elder himself must fear God and therefore refrain from imposing.