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."
Related hadith on this topic