Islamic Ruling on Praying with Torn Clothes Covering the Awrah
Prayer is valid if the torn part of the awrah can be covered by hand during the entire prayer, but wearing proper clothing is better.

According to the Islamic ruling explained by Islamic scholars, if clothing is torn in the awrah area but the opening is small enough to be covered by the hand, then praying in such clothing is valid. This is because the main purpose of covering the awrah is fulfilled, even if it is done by using the hand.
If a person is able to keep the hand on the torn area throughout the entire prayer, then the prayer is allowed. However, if another piece of clothing is available, it is better to wear it so the prayer is performed with all recommended acts properly observed. This is mentioned in the fatwa of Islamic scholars.
It is important to note that if the awrah is exposed in a way that cannot be covered by the hand, or if during any pillar of the prayer it is not possible to keep it covered, then the prayer will not be valid according to the Islamic ruling.