I asked Anas bin Malik about shortening the prayer, and he said, "Whenever the Messenger of Allah ﷺ travelled a distance of three miles or three farsakhs," — Shuba was the one uncertain about which — "he would pray two rakahs."
سألت أنس بن مالك: عن قصر الصلاة فقال: كان رسول الله ﷺ إذا خرج مسيرة ثلاثة أميال، أو ثلاثة فراسخ- شعبة الشاك- صلى ركعتين.
Muslim reported it in the Book of the Prayer of Travelers (691), from Abu Bakr bin Abu Shayba and others, from Ghundar (who is Muhammad bin Jafar), from Shuba, from Yahya bin Yazid Hinai, and he mentioned it. It is also in al-Musannaf (2/332, edited by Lahham). Imam Ahmad reported it (12313) from Muhammad bin Jafar with the same chain, saying at the beginning of the hadith, "I asked Anas bin Malik about shortening the prayer. He said, 'I used to travel to Kufa and would pray two rakahs until I returned.'" Anas said, "The Messenger of Allah ﷺ," and he mentioned it.Abu Dawud reported it (1201) with wording similar to Muslim's. Bayhaqi reported it (3/146) from Abu Dawud and Hakim, through the route of Muhammad bin Jafar with the same chain, and in it Yahya bin Yazid Hinai says, "I used to travel to Kufa and would pray two rakahs until I returned." Anas said, and he mentioned it. This makes clear that the one who was traveling was Yahya bin Yazid Hinai.As for his statement, "when he sets out on a journey of three miles, or a journey of three farsakhs," its meaning is the beginning point for shortening the prayer for the traveler, not the minimum distance that defines travel itself. This is what Qurtubi, may Allah have mercy on him, indicated in al-Mufhim (2/332).Hafiz bin Hajar mentioned in Fath al-Bari (2/567) that Nawawi said the Zahiris held that the minimum distance for shortening the prayer is three miles, and it seems they relied for this on what Muslim and Abu Dawud reported from the hadith of Anas. Hafiz bin Hajar said, "It is the most sahih and most explicit hadith reported on this matter. Those who disagreed with it interpreted it to mean the distance at which shortening the prayer begins, not the minimum distance of travel itself. But the difficulty of this interpretation is not hidden, especially since Bayhaqi mentioned in his narration from this route that Yahya bin Yazid, its narrator from Anas, said, 'I asked Anas about shortening the prayer. I used to travel to Kufa,' meaning from Basra, 'and would pray two rakahs at a time until I returned.' Anas then mentioned the hadith. This makes it clear that he was asking him about the permissibility of shortening the prayer during travel, not about the point at which shortening begins." End of quote.However, it appears that the distance specified in the hadith of Anas is indeed the starting point for shortening the prayer. As for defining the minimum distance of travel itself, the correct view is what Sheikh Islam bin Taymiya said, which his student Hafiz bin Qayyim endorsed, saying, "The Prophet ﷺ did not set for his nation a fixed distance for shortening the prayer or breaking the fast. Rather, he left that open for them in any journey or travel through the land, just as he left tayammum open for them in every journey. As for what is reported from him specifying a day, or two days, or three days, none of that is sahih from him at all." End of quote. See Zad Mad (1/481).As for the discussion of the jurists regarding the minimum distance for shortening the prayer, it amounts to approximately eighty kilometers. For more, see Minna Kubra (2/131).