this going to sound crazy but,I have bred dogs before and was a small animal breeder for 27 years,but I saved a shih tzu age 2 from a neighbor sending her to a shelter because she was pooping blood,which was just worms,the neighbor was a young black woman that lived in a house of ten people, the dog was given to her, but she tired of it,and when it got bloody poop was ready to dump it, I took the dog,had it spayed, micro chipped,and given shots, she is very healthy,but is a mess,she fights you to eat,they only gave her canned food, I can not leave the bed made up because she started using it for a bathroom,I have a mattress cover that plastic,I found out they kept her crated because she was doing the same for her,she will take off in a minute,is very sweet , but very very dumb,I am japanese and live in a black neighborhood,because of being disabled, but I have a nice house thats a good size,all wood floors, she will hold herself until time to go outside,and if she goes in house of coarse its not on the papers,I have cats that are very good and play with her,I keep her on a leash if I keep the bed made up for the day,I have finally gotten her eating dry food, but its because I put nothing else down,so she has to eat it,If I am sitting at the desk, she will wrap herself up with the 6 feet long leash,and I have to untangle her,I am in need of ideas,this has me at a loss,
Now, the problem is that Shih Tzus can be a very stubborn breed that's really hard to train if you're no persistent enough. Considering her age might make it even worse. I would say, take her out about every 20-30 minutes, for at least 15 minutes and praise her to death once she eliminates outside. Now if this isn't possible for you because of being disabled, well... One more thing that makes it really hard here. You could try the same with a litter box but it won't be the same of course and might take much more patience and time.

Put it close to where she uses to pee and poop right now. Place her in there every 30 minutes, after a nap and after playtime. If you catch her in the act, say loudly "No!", pick her up and put her into the litter box. You may try to put some of her fences inside of the box too, but this could also have the exact opposite as reaction, causing her to do it everywhere except her box. (This is for poop, shouldn't happen for pee)

Once she does it inside of the litter box, praise her like crazy and give her yummy treats. You can also give her treats every time you put her in the box for training. Show her that the box is a good thing. First, place it close to where she uses to go. Once she is litter box trained, slowly moved it to where you want it to be. And by slowly I mean like a centimetre every week or so.

As you said yourself, she's 'a mess' so you slowly need to rehabilitate her. It's not gonna work out in a day or a week, not even a year. Dogs continue learning all their life and if you have one poor fella like this one, it will take some extra time. If a mentally fully healthy dog, which this is surely not, learns potty in about 1 month or so, it might yours take 3 or even more, to cut it down to only accidents but no intentional pooping inside.

What has been done to her can definitely be classified as abuse, even if she hasn't been (well I hope so) beaten or anything. Dogs can be mentally instable just like humans. You should definitely consult help for getting her used to the leash too. (Won't note anything more down here, gonna be too long...) Train her basics like sit, come, etc. Train her body and her mind, they need both to be stimulated. Give her lots of affection and show her that she can trust you. I believe that you can do it but most of all you have to think so too. If you ain't sure of, how do you expect the dog to be?
You need to keep her with you as often as possible until she learns to hold her bladder. When you see her going to the bathroom lead her outside and then praise her for going. It may take a long time, but never yell at her for going to the bathroom. Try to keep her to one room, so she doesn't go to the bathroom all over your house and walk her outside every hour.