This could be due to weakening muscles with age, or possibly even a mental condition such as canine cognitive dysfunctiona medical issue similar to human Alzheimer's disease. Your dog also may have developed a health problem that is causing him or her to be unable to control pooping indoors.