So sorry your sweet senior is going through this. I home senior labs and have come across these problems.
Good to hear that the liver issues are resolved. Is he now gaining weight back? Is his weight appropriate for his size? Keeping weight down on an older dog is so important for joints.
The pooping in the house is not his fault. With probable arthritis not only in the legs but in the spine, he does not realize when he has to go and the poop just falls out. Our Melody had this. I just picked it up and made no fuss about it or even let her know. She had lower spine arthritis. We found that Tramadol helped with the discomfort and also solved the losing poop problem.
Restlessness may be due to doggy dementia. Melody also had this. Also, pain may be causing restlessness. We found that the easing of pain with Tramadol the restlessness decreased. She still would stand or sit and stare off at nothing for short periods of time.
At this time quality of life is most important. If he is still eating, interacting with the family, has a sparkle in his eyes, he still has quality of life. Yes, it is expensive but an expense I gladly took on to give quality of life. It's hard to realize, but they do tell you when life is too difficult. Melody did very well for months after we started medication and was one happy girl. You know your dog best and you will see when there is a change, life has no quality. He can tell you when he is suffering and not happy. Have a good heart to heart discussion with you vet to help guide you during this time.
During this time, spend as much time as you can with him, spoil him, and soak up the love he is so freely giving you.
Gentle hugs and prayers being sent for many more days, weeks and months of having you sweet baby with you.