If, after accepting Islam, a person gets no opportunity for any deed other than jihad, his success in the Hereafter is still certain
عن أبى اسحاق قال سمعت البراء رضى الله عنه يقول أتي النبى صلى الله عليه وسلم رجل مقنع بالحديد فقال يا رسول الله أقاتل أو أسلم قال أسلم ثم قاتل فأسلم ثم قاتل فقتل فقال رسول الله صلى الله عليه وسلم عمل قليلا وأجر كثيرا.
“It is narrated from Abu Ishaq, who said: I heard al-Bara’ ibn ‘Azib (may Allah be pleased with him) say: A man wearing armor came to the Prophet ﷺ and said: “O Messenger of Allah! Should I first take part in the fighting, or should I first accept Islam?” The Messenger of Allah ﷺ said: “First become a Muslim, then take part in the battlefield.” So he first accepted Islam, then took part in the fighting, and after that he was martyred in the fighting itself. The Messenger of Allah ﷺ said: “He did little, but he gained a great reward.””
Explanation
From this hadith we learn that becoming a Muslim first is a condition for the acceptance of every good deed. If a non-Muslim does a good deed, he is given its reward in this world, but in the Hereafter he has nothing.
From this hadith we also learn that if a person has accepted Islam sincerely, and after that gets no opportunity to do good deeds, not even to perform the obligatory duties, then his reward with Allah has become binding.