Praise be to Allah.
We praise Allaah for having guided our brother to Islam, and we ask Him, may He be glorified and exalted, to make him steadfast, strengthen his faith and increase his worship.
If this brother is doubting that he uttered the shahaadatayn after two years of fasting, praying and striving to follow the religion as much as he can, this is undoubtedly waswaas (whispers) from the shaytaan who wants to upset him and make him feel anxious and worried. What is definite is that this brother has repeated the shahaadatayn during this lengthy period time after time. Has he not been repeating the adhaan after the muezzin all this time? Has he not said sometimes Laa ilaaha ill-Allaah Muhammad Rasool Allaah? Does he not pray? For in the tashahhud during the prayer he says: I bear witness that there is no god but Allaah and I bear witness that Muhammad is the Messenger of Allaah.
Moreover the fact that he prays is regarded as entering into Islam. Hence the scholars said of the kaafir: If he prays then he is a Muslim according to the rules, i.e., he is judged to be a Muslim even if he does not utter the shahaadatayn.
See: al-Sharh al-Mumti’ (2/12) and al-Mawsoo’ah al-Fiqhiyyah (4/272).
This is also indicated by the report narrated by al-Bukhaari (391) from Anas ibn Maalik (may Allaah be pleased with him) who said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Whoever prays as we pray and faces the same qiblah (direction of prayer) that we face and eats meat slaughtered by us, he is the Muslim.”
We should beware of waswaas which befalls some people and makes them confused as to whether they said or did something or not, because waswaas is a sickness, and the remedy for it is dhikr (remembering Allaah) and not paying any attention to it.
See also the answer to question no. 62839.
And Allaah knows best.