Praise be to Allah.
Islam is not just uttering the Shahaadatayn only, rather it is essential to fulfil the conditions of this twin declaration of faith so that the one who utters them will truly be a Muslim. The pillars of Islam are believing, uttering and acting.
It was narrated that Ubaadah ibn al-Saamit said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Whoever says ‘I bear witness that there is no god except Allaah alone [with no partner or associate] and that Muhammad is His slave and Messenger, and that ‘Eesa is the slave of Allaah, the son of His maidservant, a Word which He bestowed upon Maryam and a Spirit created by Him, and that Paradise is true and that Hell is true, Allaah will admit him through whichever of the eight gates of Paradise he wants.”
Narrated by al-Bukhaari (3252) and Muslim (28).
Shaykh ‘Abd al-Rahmaan ibn Hasan ibn Muhammad ibn ‘Abd al-Wahhaab (may Allaah have mercy on him) said:
The words “Whoever says ‘I bear witness that there is no god except Allaah alone” mean, the one who speaks these words, knowing what they mean and acting upon them inwardly and outwardly, because with regard to the Shahaadatayn it is essential that one know and be certain and act upon them as Allaah says (interpretation of the meaning): “So know (O Muhammad صلى الله عليه وسلم) that Laa ilaaha illAllaah (none has the right to be worshipped but Allaah)” [Muhammad 47:19].
And Allaah says (interpretation of the meaning): “except for those who bear witness to the truth knowingly (i.e. believed in the Oneness of Allaah, and obeyed His Orders), and they know (the facts about the Oneness of Allaah)” [al-Zukhruf 43:86]. As for uttering the words without knowing the meaning or believing with certainty or acting upon them by disavowing shirk and being sincere in word and deed, and saying in one's heart and on one's lips and acting in one’s heart and with one's outward faculties, that is of no benefit, according to scholarly consensus.
Al-Qurtubi said in al-Mufhim ‘ala Saheeh Muslim: Chapter: it is not sufficient merely to speak the Shahaadatayn, rather it is essential to believe it with certainty in one’s heart. This draws attention to the flawed argument of the extreme Murji’ah who say that merely uttering the Shahaadatayn is sufficient to make one a believer. The ahaadeeth on this subject indicate that this is wrong; rather it is a view that is well known to be wrong according to sharee’ah, because it implies a justification of hypocrisy, and judging hypocrites as true believers, which is completely false. End quote.
This hadeeth also indicates this, in the words “whoever bears witness” because bearing witness can only be valid if it is based on knowledge, certainty, sincerity and honesty.
Fath al-Baari (p. 36).
There are seven conditions of bearing witness that there is no god but Allaah, and it does not benefit the one who says it unless he fulfils all of them. They are, in brief:
1-Knowledge as opposed to ignorance
2-Certainty as opposed to doubt
3-Acceptance as opposed to rejection
4-Obedience as opposed to disobedience
5-Sincerity as opposed to shirk
6-Honesty as opposed to lying
7-Love as opposed to its opposite, which is hate.
The conditions of bearing witness that Muhammad is the Messenger of Allaah are the same as the conditions of bearing witness that there is no god but Allaah, which have been mentioned with evidence in the answers to questions no. 9104 and 12295.
And Allaah knows best.