Negative commandment · Lo Ta’aseh #362 of 613
Not to appoint a convert [to a position of authority] over the Jewish people
שלא למנות על ישראל איש מקהל גרים
The verse · Devarim 17:15
שׂוֹם תָּשִׂים עָלֶיךָ מֶלֶךְ אֲשֶׁר יִבְחַר ה׳ אֱלֹהֶיךָ בּוֹ מִקֶּרֶב אַחֶיךָ תָּשִׂים עָלֶיךָ מֶלֶךְ לֹא תוּכַל לָתֵת עָלֶיךָ אִישׁ נׇכְרִי אֲשֶׁר לֹא־אָחִיךָ הוּא
“then thou mayst appoint a king over thee, whom the Lord thy God shall choose: one from among thy brethren shalt thou set as king over thee: thou mayst not set a stranger over thee, who is not thy brother.”
The Rambam’s words
Not to appoint a convert [to a position of authority] over the Jewish people, as [Deuteronomy 17:15] states: "You may not appoint a foreigner over you."
שלא למנות על ישראל איש מקהל גרים, שנאמר "לא תוכל לתת עליך איש נוכרי" (דברים יז,טו).
Why · Sefer HaChinuch #498
To not establish a foreign king over us
“The roots of the commandment are well-known: Since it is for the appointed head to humble all in everything that he says, it is necessary that he nonetheless be from the seed of Israel — as they are merciful, the children of merciful ones — so that he will have mercy on the people not to make their yoke heavy in any matter from all of the things.”
Who & when
“And this prohibition regarding the monarchy is practiced at the time that Israel is on its Land in its settlement, and it is from the warnings (negative commandments) that are upon the whole community.”
Where in the Mishneh Torah
Hilchot Kings and Wars הלכות מלכים ומלחמות