Shaykh Ibn Uthaymeen was asked, “The conditions for the judgement of
takfir of a Muslim? And the judgement upon the one who did any action
that is mukaffir (i.e. expels from the religion) but only in jest (not
seriously)?”
The Shaykh replied by saying, “For the judgement of the takfir of a
Muslim, there are two conditions: The first, that the evidence that this
matter is something that expels from the religion is established. The
second, the application of the ruling upon the one who does that, in
that he has knowledge of it and that he intends it (aaliman bidhaalik
qaasidan lahu).
Thus, if he is ignorant, he does not become a disbeliever, due to His
saying, “And whoever contends with the Messenger after the guidance
has been made clear to him, and he follows a path other than the path of
the believers, We shall leave him in the path he has chosen and land him
in Jahannam, an evil refuge” (4:115) and His saying, “And Allaah
is not one to misguide a people after He has guided them, until He
explains to them that which they should avoid…” (9:115), and His
saying, “And We never punish until we have sent a Messenger.”
(17.15).
However, when this person is neglectful in abandoning learning and
attaining clarity, he is not to be excused. Such as when it reaches him
that this action of his is kufr, and then he does not verify it (that it
is as such), and nor does he investigate, then in this situation, he is
not to be excused.
And if he did not intend (ghayr qaasid) the action (i.e. wilfully,
knowingly, deliberately), then he does not become a disbeliever. He does
not become a disbeliever. Such as for example, when he is compelled to
kufr while his heart is secure with Imaan, such as when his thinking
becomes confused, so he does not know what he is saying, due to extreme
joy and what is like that. Or such as the man with the camel who lost
it, then he sat under the tree, waiting for death, and then he finds it
tied to the tree, and so he takes it, then he said, “O Allaah, you are
my servant and I am your lord”, so he erred due to extreme joy.
However, the one who did something that expels from the religion,
only in jest (maazihan), then he becomes a disbeliever, because he
intended that [action or statement] (qasada dhaalik), as has been
textually stated by the people of knowledge.” (Majmoo al-Fataawaa,
2/125-126).