The Shulchan Aruch · Yoreh De'ah
יורה דעה רמ״דYoreh De'ah 244
Siman 244 of 402 in Yoreh De'ah — 18 se'ifim
הלכות כבוד תלמיד חכםHonoring a Torah Scholar· siman 244
Se’if 1א׳
מִצְוַת עֲשֵׂה לָקוּם מִפְּנֵי כָּל חָכָם, אֲפִלּוּ אֵינוֹ זָקֵן אֶלָּא יַנִּיק וְחַכִּים, וְאֲפִלּוּ אֵינוֹ רַבּוֹ, רַק שֶׁהוּא גָּדוֹל מִמֶּנּוּ וְרָאוּי לִלְמֹד מִמֶּנּוּ. (טוּר בְּשֵׁם הָרַמְבַּ"ם ור"ן פ"ק דְּקִדּוּשִׁין). וְכֵן מִצְוָה לָקוּם מִפְּנֵי שֵׂיבָה, דְּהַיְנוּ בֶּן שִׁבְעִים שָׁנָה, אֲפִלּוּ הוּא עַם הָאָרֶץ, וּבִלְבַד שֶׁלֹּא יִהְיֶה רָשָׁע. (בֵּית יוֹסֵף בְּשֵׁם הַתּוֹסָפוֹת וּבְהַגָּהוֹת מיי' פ"ו וּמָרְדְּכַי פ"ק דְּקִדּוּשִׁין וְר' יְרוּחָם ןר"ן ורַבֵּנוּ תָּם).
Standing and showing honor before a sage, even if he is not one’s teacher. Containing 18 paragraphs: It is a positive commandment to stand up before any sage, even if he is not elderly but is a young scholar, and even if he is not one’s teacher (as long as he is greater than oneself and worthy of being learned from) (Tur quoting the Rambam and Ran, first chapter of Kiddushin). Likewise, it is a mitzvah to stand before an elderly person—i.e., someone aged seventy—even if he is an ignoramus, provided he is not wicked (Beit Yosef quoting Tosafot, Hagahot Maimoniyot ch. 6, Mordechai Kiddushin, Rabbeinu Yeruḥam, Ran, and Rabbeinu Tam).
Se’if 2ב׳
מֵאֵימָתַי חַיָּב לָקוּם מִפְּנֵיהֶם, מִשֶּׁיַּגִּיעַ לְתוֹךְ אַרְבַּע אַמּוֹתָיו עַד שֶׁיַּעֲבֹר מִכְּנֶגֶד פָּנָיו. וְרוֹכֵב כִּמְהַלֵּךְ דָּמֵי.
From when is one obligated to stand before them? From the moment they enter within four cubits (about two meters) until they pass out of one’s line of sight. Someone riding is considered as walking.
Se’if 3ג׳
אָסוּר לְהַעֲצִים עֵינָיו מִמֶּנּוּ קֹדֶם שֶׁיַּגִּיעַ לְתוֹךְ אַרְבַּע אַמּוֹתָיו, כְּדֵי שֶׁלֹּא יִצְטָרֵךְ לָקוּם מִפָּנָיו כְּשֶׁיַּגִּיעַ לְתוֹךְ אַרְבַּע אַמּוֹתָיו.
It is forbidden to deliberately close one’s eyes before he reaches within four cubits in order to avoid having to stand up for him when he comes closer.
Shulchan Aruch, Yoreh De'ah — Torat Emet 357 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0