A:
It is obligatory for a Muslim to perform Salah according to their ability, because Allah (Exalted be He) says:
So keep your duty to Allâh and fear Him as much as you can
(Part No. 6; Page No. 372) If people can purify themselves fully from Hadath (major and minor ritual impurities) and Najasah (filth such as urine, blood etc), they must do so,
because Taharah (ritual purification) is a prerequisite of the validity of Salah and they must face the Qiblah. If they cannot fulfill any of the mentioned conditions or even some of them, they can offer Salah in the way they can. If in the state you mentioned you could not use water for purification or Tayammum (dry ablution with clean earth) and you could not wash off the impurity from your body or clothes and so you offered Salah according to your ability, your Salah will be valid In sha’a-Allah (if Allah wills).Once you are able to remove the impurity it is obligatory that you should wash it off your clothes and your body. Also, when you are able you must perform Ghusl (ritual bath) following Janabah (major ritual impurity related to sexual discharge), if you had a wet dream during the period you mentioned, for future Salahs.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.