Mishkat al-Masabih 59
Anas reported God’s messenger as saying, “Three matters pertain to the root of faith:
no molestation of one who says there is no god but God, neither declaring him an infidel because of a sin, nor excommunicating him from Islam because of an action; jihad continues from the time God sent me till the last of this people fights with the dajjal, being annulled neither by the tyranny of a tyrannical ruler nor the justice of a just one; and belief in God’s decrees.” 

Abu Dawud transmitted it.
وَعَنْ أَنَسِ بْنِ مَالِكٍ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسلم: «ثَلَاث من أَصْلِ الْإِيمَانِ الْكَفُّ عَمَّنْ قَالَ لَا إِلَهَ إِلَّا الله وَلَا نكفره بذنب وَلَا نخرجهُ من الْإِسْلَام بِعَمَل وَالْجِهَادُ مَاضٍ مُنْذُ بَعَثَنِي اللَّهُ إِلَى أَنْ يُقَاتل آخر أمتِي الدَّجَّالَ لَا يُبْطِلُهُ جَوْرُ جَائِرٍ وَلَا عَدْلُ عَادل وَالْإِيمَان بالأقدار» . رَوَاهُ أَبُو دَاوُد