You may notice that although your cat and dog tend to follow you into the bathroom carefree (or sometimes insistently), they may come off as almost shy when they use their litter box or pee or poop outside.
Are they ashamed? Do they feel embarrassed? Do they need their privacy using the potty?
There are a few reasons your dog or cat might not be keen to have people around seeing them do their business.
Although your pet cannot feel shame or embarrassment like we feel it, they do have an instinct to survive. And to survive in nature, one must stay strong and vigilant, and never let their guard down. Which is impossible when you have to poop. If you are seeing your dog or cat looking nervous and unable to do their business while being watched, it could be because they don't want to be attacked. This is why dogs and cats will cover their excrement, so as not to leave behind their scent and attract predators.
The act of making eye contact with a dog or a cat can be seen as an act of aggression, and when your pet is defecating they are in no position to fight off predators. This might result in them trying to hold it as long as possible until the threat has passed and they can pee in peace. This may especially be the case if your pet is not yet used to you, or has trust issues. Do your best to to give your pet space and not look them in the eye when they're doing their business.
Fear of punishment
Many dogs and cats have been punished in the past for peeing or pooping in inappropriate places while they learn when and where to use the bathroom. If they pee on the floor, people tend to yell or get upset, and this is scary to a pet. Cats or dogs, especially if they're young, might take that to mean that means all pooping and peeing is bad. In order to avoid your wrath or punishment, they may hide as they poop or pee.
If this is the case, stay in plain sight of your pet, but don't stare them down. If they see you in a non-aggressive way as they use the bathroom, they will be less afraid and less inclined to poop under a chair for fear of punishment. Use a reward system if they poop and pee in the correct location.
Dogs and cats are both creatures of habit. They like to keep their bathroom business away from where they eat, drink and play. Much of the time, you will find your pet peeing or pooping in the same location regularly. When you (someone who has no business with them doing their business) are suddenly there, they might feel a little confused. They kept everything so organized, after all! So if you are walking your dog outside and they seem disinclined to defecate, you can step away a little to give them space. (Just keep hold of the leash).
With cats, since most likely they are using their litter box, you can step away, leave the room or very obviously look away. That way they know you aren't getting things all mixed up.
In general, if you pet appears to want privacy, do your best to accommodate their need. Speak soothingly and let them know they are not in harm's way. To help your pet feel less shy, it is always best to establish trust so that they know they are safe, especially when they're in the vulnerable position of using the bathroom.