If there is a reason for doing tayammum - such as non-availability of water, or being unable to use it because of sickness etc - then tayammum takes the place of wudoo' and ghusl. So the person who is junub should do tayammum and pray, then when he finds water he has to do ghusl.
This is indicated by the Qur'aan and Sunnah.
1 - Allaah says (interpretation of the meaning):
O you who believe! When you intend to offer As-Salaah (the prayer), wash your faces and your hands (forearms) up to the elbows, rub (by passing wet hands over) your heads, and (wash) your feet up to the ankles. If you are in a state of Janaaba (i.e. after a sexual discharge), purify yourselves (bathe your whole body). But if you are ill or on a journey, or any of you comes after answering the call of nature, or you have been in contact with women (i.e. sexual intercourse), and you find no water, then perform Tayammum with clean earth and rub therewith your faces and hands
So Allaah has enjoined upon us both minor and major purification, and tayammum could take the place of either of them. This was stated by Shaykh al-Islam Ibn Taymiyah in Majmoo' al-Fataawa (21/396). Minor purification is wudoo' and major purification is ghusl.
2 - al-Bukhaari narrated in two places (344 and 348) from Imraan ibn Husayn (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) saw a man keeping away and not praying with the people. He said, O So and so, what kept you from praying with the people? He said, O Messenger of Allaah, I became junub and there is no water. He said, You should use clean earth, for it will suffice you. According to another report the Prophet (peace and blessings of Allaah be upon him) found water and gave a vessel of water to the one who had become junub, and said, Go and pour this over yourself.
This indicates that tayammum is a means of purification and suffices instead of water, but if water is available then it must be used. Hence the Prophet (peace and blessings of Allaah be upon him) told him to pour it on himself even though no new janaabah had occurred. This was stated by Ibn Uthaymeen in Majmoo' al-Fataawa, 11/239.
3 - Muslim (368) narrated that a man came to Umar and said: I have become junub and I cannot find any water. He said: Do not pray. Ammaar said: Do you not remember, O Ameer al-Mu'mineen, when you and I were on a campaign and we become junub, and we could not find any water? You did not pray, but I rolled in the dust and prayed, and the Prophet (peace and blessings of Allaah be upon him) said, It would have been sufficient if you had struck the ground with your hands then wiped your face and hands with them.' Umar said: Fear Allaah, O Ammaar! He said, If you wish I will not narrate it. Umar said: We accept what you say. According to another report, Ammaar said: O Ameer al-Mu'mineen, if you wish, because of your position, I will not tell it to anyone.
Umar (may Allaah be pleased with him) had forgotten that event.
Umar said: Fear Allaah, O Ammaar!' - What this means is that Umar said to Ammaar: Fear Allaah with regard to what you are narrating, for perhaps you have forgotten or become confused. With regard to Ammaar saying, If you wish I will not narrate it, what this means - and Allaah knows best - is: If you think it is better for me to refrain from narrating it than to narrate it, then I will refrain, because it is obligatory for me to obey you so long as that does not involve sin. The basic principle with regard to conveying knowledge had already been fulfilled, and if he had withheld this hadeeth after that, he would not have come under the heading of those who withhold knowledge. It may be that he meant, I will not broadcast it so that it becomes well known among people, rather I will only narrate it rarely.' This was stated by al-Nawawi.
Umar said We accept what you say - i.e., the fact that I do not remember it does not means that it is not true, and I have no right to stop you narrating it. This was stated by al-Haafiz in Fath al-Baari.
4 - Abu Dawood (334) narrated that Amr ibn al-Aas said: I had a wet dream on a cold night during the campaign of Dhaat al-Salaasil, and I was afraid that I would die if I did ghusl, so I did tayammum then I led my companions in praying Fajr. They mentioned that to the Prophet (peace and blessings of Allaah be upon him) and he said: O Amr, you led your companions in prayer when you were junub? So I told him what had kept me from doing ghusl. I said: I heard that Allaah says (interpretation of the meaning): And do not kill yourselves (nor kill one another). Surely, Allaah is Most Merciful to you' [al-Nisa' 4:29]. The Messenger of Allaah (peace and blessings of Allaah be upon him) smiled and did not say anything.
Al-Haafiz said in al-Fath (1/589): its isnaad is qawiy (strong). It was classed as saheeh by al-Albaani in Saheeh Abi Dawood.
Al-Bukhaari (may Allaah have mercy on him) said in his Saheeh: If a person who is junub fears that he may become ill or die or fears thirst then he should do tayammum, and he mentioned that Amr ibn al-Aas became junub on a cold night so he did tayammum, and recited (the verse) (interpretation of the meaning): And do not kill yourselves (nor kill one another). Surely, Allaah is Most Merciful to you' [al-Nisa' 4:29]. He mentioned that to the Prophet (peace and blessings of Allaah be upon him) and he did not rebuke him.
Shaykh al-Islam Ibn Taymiyah said in Majmoo' al-Fataawa (21/451):
Whoever becomes junub whether as the result of a wet dream or intercourse - permissible or forbidden - has to do ghusl and pray. If he is unable to do ghusl because there is no water or because he will be harmed by using it - such as if he is sick and using water will make his sickness worse, or there is a cold wind and he fears that if he does ghusl he will become sick with a headache or cold or bronchitis - then he should do tayammum and pray. This applies equally to men and women. He (or she) does not have the right to delay the prayer beyond its prescribed time.
Shaykh Ibn Baaz was asked in Majmoo' al-Fataawa (10/201):
Does tayammum mean that the junub person no longer has to do ghusl at all? How many prayers may he offer with tayammum?
Tayammum takes the place of water, as Allaah has made the earth a place of worship and a means of purification for the Muslims. If no water is available or the person is unable to use it because of sickness, then tayammum takes its place and remains sufficient until he finds water. When he finds water he has to do ghusl to cleanse himself of the previous janaabah. Similarly if the sick person recovers and Allaah heals him, he has to do ghusl to cleanse himself from the previous janaabah from which he had purified himself by means of tayammum, because the Prophet (peace and blessings of Allaah be upon him) said: Clean earth is the wudoo' of the Muslim if he cannot find water for ten years. Then he said: When you find water, then make it touch your skin. Narrated by al-Tirmidhi from the hadeeth of Abu Dharr (may Allaah be pleased with him); narrated by al-Bazzaar and classed as saheeh by Ibn al-Qattaan, from the hadeeth of Abu Hurayrah may Allaah be pleased with him.
If the junub person finds water then he should make it touch his skin, i.e. wash with it. With regard to his past prayers, they are valid by virtue of the tayammum he did when water was not available or he was unable to use it, because of sickness that prevented him from using it, until the sickness ends and he recovers and until he finds water, if none was available, even if that takes a long time.
Reproduced from Islam QA