If a person is so ill that he cannot control his discharge of urine and stools, how can he offer his prayers?
If the person is aware of the situation and can attend to his needs, he should clean himself for prayer, and he can combine Dhuhr and Asr together, and Maghrib and Isha together, to ease his difficulty. However, the illness you have mentioned could be managed if proper medical attention is given.
In a different situation, where no improvement is likely and the elderly person has lost most of his normal senses, to the extent that he is largely unaware of what goes on around him, prayer may not be required of him. However, the case should be considered on its own.