The Messenger of Allah ﷺ said, "Three things are among the foundations of faith. Refraining from harming whoever says 'There is no god but Allah,' not declaring him an unbeliever for any sin, and not expelling him from Islam for any deed. Jihad continues from the time Allah sent me until the last of my community fights the Dajjal, neither nullified by the tyranny of a tyrant nor by the justice of a just ruler. And belief in the divine decrees."
حدثنا سعيد بن منصور حدثنا أبو معاوية حدثنا جعفر بن برقان عن يزيد بن أبي نشبة
قال رسول الله ﷺ ثلاث من أصل الإيمان الكف عمن قال لا إله إلا الله ولا نكفره بذنب ولا نخرجه من الإسلام بعمل والجهاد ماض منذ بعثني الله إلى أن يقاتل آخر أمتي الدجال لا يبطله جور جائر ولا عدل عادل والإيمان بالأقدار
No references are available.
[Its isnad is daif] Bayhaqi related it, 9/156, from the hadith of Abu Dawud through this route, and it is found in Sunan Saeed bin Mansur, no. 2367. Yazid bin Abu Nashbah is majhul (Taqrib).