My two late, much loved dogs had some serious incontinence issues the last few months of their lives. We used doggy diapers with liners. For male dogs it is a belly band. He had kidney failure and couldn’t give us warning that he had to go out. For female dogs the diapers have a hole for her tail. She had dementia and didn’t know she had to go (or that she had gone).