It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the people began asking him about the prayer while travelling, so he said: "When the Messenger of Allah (peace and blessings be upon him) set out from his family on a journey, he would not pray more than two rak'ahs until he returned to his family."
It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that when the Messenger of Allah (peace and blessings be upon him) was travelling, he would pray only two rak'ahs.
It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that when the Messenger of Allah (peace and blessings be upon him) set out from his house on a journey, he would keep praying only two rak'ahs (for each prayer) until he returned.
Abu al-Safar's name is Sa'id bin Yuhmid al-Hamdani.
Imam Ahmad (may Allah have mercy on him) also narrated this hadith from Hajjaj, from Shu'bah.
Imam al-Bukhari (may Allah have mercy on him) narrated through Ikrimah from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) travelled and stayed (in one place) for nineteen days, shortening the prayer; so when we travel and stay nineteen days, we shorten, and if we stay longer than that, we pray in full.
Imam Muslim (may Allah have mercy on him) narrated through Musa bin Salamah bin al-Muhabbiq from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that he said: I asked Ibn Abbas (may Allah be pleased with them both): "How should I pray when I am in Makkah and I am not praying with the imam?" He said: "Two rak'ahs; this is the Sunnah of Abu al-Qasim (peace and blessings be upon him)."
I (the author) say: Its wording differs from the wording we have mentioned.