The Shulchan Aruch · Orach Chayim
אורח חיים ת״הOrach Chayim 405
Siman 405 of 697 in Orach Chayim — 9 se'ifim
הלכות תחומיןLaws of Techumin· siman 405
Se’if 1א׳
מִי שֶׁיָּצָא חוּץ לַתְּחוּם אֲפִלּוּ אַמָּה אַחַת, לֹא יִכָּנֵס לִהְיוֹת כִּבְנֵי הָעִיר וְאֵין לוֹ אֶלָּא אַרְבַּע אַמּוֹת מֵעֲמִידַת רַגְלָיו וְלַחוּץ.
Laws of those who leave the Techum One who leaves the Shabbat barrier even a single amah (cubit), he should not enter to be like a member of the city, and he only has four amot from [where] he is standing and out.
Se’if 2ב׳
הָיְתָה רַגְלוֹ אַחַת תּוֹךְ הַתְּחוּם וְרַגְלוֹ אַחַת חוּץ לַתְּחוּם, יִכָּנֵס.
If his leg is inside the barrier and one leg is outside the barrier, he should enter.
Se’if 3ג׳
מִי שֶׁקָּדַשׁ עָלָיו הַיּוֹם וְהוּא חוּץ לַתְּחוּם הָעִיר אֲפִלּוּ אַמָּה אַחַת, לֹא יִכָּנֵס לִהְיוֹת כִּבְנֵי הָעִיר וְאֵינוֹ מְהַלֵּךְ אֶלָּא אַלְפַּיִם אַמָּה לְכָל רוּחַ מִמָּקוֹם שֶׁקָּדַשׁ עָלָיו הַיּוֹם.
One, when Shabbat begins, is outside the barrier of the city, even a single amah, he should not enter to be like a member of the city, and he should only walk two thousand amot in each direction from the place he was in when Shabbat began.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0