Bereshit / Genesis 49:10
לֹא־יָסוּר שֵׁבֶט מִיהוּדָה וּמְחֹקֵק מִבֵּין רַגְלָיו עַד כִּי־יָבֹא שילה [שִׁילוֹ] וְלוֹ יִקְּהַת עַמִּים׃
The sceptre shall not depart from Yehudah, nor the lawgiver from between his feet, until Shiloh comes, and to him shall be the obedience of the peoples.
Pshat פְּשָׁט
Sceptre and lawgiver
Rashi: the "sceptre" is rule from David onward, the exilarchs in Babylonia. The "lawgiver" is the students, the princes of the Land of Israel. "Shiloh" is King Mashiach (the Messiah), to whom the kingship belongs, "shai lo", "a gift to him". "The obedience of the peoples" is their gathering around him. Haamek Davar: the "lawgiver" is the one who finds new things in Torah, and that is possible only with students. Students sat on the ground at their teacher's feet: hence "from between his feet".
How Rashi and Haamek Davar explain it
Remez רֶמֶז
Shiloh is Moshe and Mashiach
Kitzur Ba'al HaTurim: "lawgiver" (מְחֹקֵק) is 248, like the limbs of the body: Torah is "ordered in all and secure". "Shiloh comes" (יָבֹא שִׁילֹה) is 358, like "Mashiach" (מָשִׁיחַ). "Shiloh" is 345, like "Moshe" (מֹשֶׁה): Moshe "came at the head of the people" when Yehudah became His sanctuary. Midrash Lekach Tov: in "Shiloh" (שִׁילֹה) Yaakov (Jacob) hinted at the one thousand three hundred and thirty-five days of the book of Daniel, and Moshe in the words "I will surely hide My face". When they begin we do not know: "suddenly he will come".
How Kitzur Ba'al HaTurim and Midrash Lekach Tov explain it
Drash דְּרָשׁ
Scribes, teachers and the gift of nations
Midrash Lekach Tov: the "sceptre" is the scribes in Yehudah, as in "those who wield the scribe's staff". The "lawgiver" is the dwellers of Yaabetz, who teach Israel the laws. "Shiloh" is "shai lo", "a gift to him": the nations of the world will bring gifts to Mashiach son of David. "The obedience of the peoples": he will blunt the teeth of the idolaters, and all kings will bow to him.
How Midrash Lekach Tov explain it
Sod סוֹד
The end of the serpent's impurity
Agra DeKala: the last letters of the words "the woman, the serpent deceived me, and I ate" spell "Shiloh". This hints that the serpent's impurity will cease only when Shiloh comes. And the initial letters of the whole verse give 191: "end" (קֵץ, 190) plus one: at the end all will be one. Be'er Mayim Chaim: "he who spares the rod hates his son". The Holy One does not remove the rod from Yehudah, so that he will remember the fear of Heaven until Mashiach comes, and then all suffering will vanish.
How Agra DeKala and Be'er Mayim Chaim explain it