The Messenger of Allah ﷺ said, "Fasting three days of every month, and from Ramadan to Ramadan, is equivalent to fasting the entire year."
قال رسول الله ﷺ: صوم ثلاثة من كل شهر، ورمضان إلى رمضان صوم الدهر.
Muslim narrated it in the Book of Fasting (1162), from Muhammad bin Bashshar (Bundar), who said, Muhammad bin Jafar told us, who said, Shuba told us, from Ghaylan bin Jareer, from Abdullah bin Mabad Zamani, from Abu Qatada. This is part of a longer hadith that will come later in the chapter on the prohibition of fasting continuously throughout the year.Ibn Khuzayma also narrated it (2126) from Bundar himself with his chain, except that he did not mention in it "and Ramadan to Ramadan." Ibn Khuzayma said, "In the narration of Hammad bin Zayd it says, 'Fasting three days from every month, and Ramadan to Ramadan, this is fasting the whole year.'" This is what he said, and it also appears in the narration of Shuba, as mentioned earlier.