“The second matter: The funeral prayer upon a Muslim even if he was an evil doer so long as he didn’t exit the fold of Islam:
He is a Muslim, and for him is that which is for the Muslims, and upon him is that which is upon the Muslims.
As for if he exited from the fold of Islam, then it is not prayed upon him (the funeral prayer) because he isn’t a Muslim.
Not every person (can) rule upon the people with apostasy, only the people of knowledge and insight rule upon that by returning to the principles of Ahlus Sunnah Wal Jama’ah
As for every single person, than they aren’t allowed to make those rulings, even if their intention and intent is good.
The ruling is only to be made by the people of insight and those firmly grounded in knowledge
[Sharh At-Tahaawiyyah Of Shaykh Saalih Al-Fawzaan, Page 162]
Imam At Tahawi said:
154. We don’t bear witness upon them with disbelief, nor polytheism, nor hypocrisy, so long as nothing from that is made apparent from them!
Shaykh Saalih Al Fawzaan:
“The origin in regards to the Muslim is being upright, and this is a great principle. Thus we don’t have evil thoughts in regards to him, nor spy upon him, nor do we follow him up.
But if something is made apparent to us, we rule in accordance to it upon him. But, if something isn’t made apparent, then we don’t have bad thoughts of the Muslims. Thus, we deal with him in accordance to that which is made apparent from him”
[Sharh At-Tahaawiyyah Of Shaykh Saalih Al-Fawzaan, Page 165]
Shaykh Saalih Al Fawzaan said:
“Those who make Dua against the Muslim leaders are not upon the way of Ahlus Sunnah Wal Jamaah, similarly those who don’t make Dua for them.
This is a sign that they have with them deviance from the Belief of Ahlus Sunnah Wal Jamaah.
Some of them reject upon those who make Dua in the Jumuah Khutbah for the rulers, and they say this is flattery, and hypocrisy. Subhanallah! This is the way of Ahlus Sunnah, rather from the Sunnah is to make Dua for the rulers”
[Sharh At-Tahaawiyyah Of Shaykh Saalih Al-Fawzaan, Page 172]
Majid Jawed Al-Afghanee