Abd Allah ibn Umar reports that the Prophet ﷺ said: "Islam is built on five: bearing witness that there is no god but God and that Muhammad is the Messenger of God, establishing prayer, giving zakat, the pilgrimage to the House, and fasting Ramadan."
Al-Bukhari records it in the Book of Faith; Muslim records it in his Book of Faith in a wording that opens "Islam is built on five: that God be held One". Al-Tirmidhi records it and grades it hasan sahih, and al-Nawawi places it third in his Forty Hadith, saying al-Bukhari and Muslim narrated it.