Your captive bird might appear to poop almost absentmindedly, without any thought as to where they're going or who they're going on. A captive bird whom you let fly free in the house can be taught to hold their bowel movements until they're in an appropriate place to let them go.
Birds naturally can control their bowel movements to some degree. Most birds don't poop at night when they're sleeping; and nesting hens will sit for hours on their eggs without having bowel movements. A territorial bird may poop around the edges of his domain, though; and birds will poop soon after eating. Most captive birds appear to have a natural instinct to not poop on their favorite humans -- while other birds actually seem to try to poop only on certain people. With effort and consistency, you can harness such natural behaviors to potty-train your bird.
Birds often exhibit particular behaviors right before having a bowel movement. Some will squat, raise or dip their tail, or fluff their feathers. Other birds will get restless. If your bird is on your shoulder, he may climb down your arm when he has to go. If you want to potty-train your bird and eventually teach him to control his bowels, you need to spend time observing the bird so you can learn how often he goes and what telltale signs he exhibits before going.
Generally speaking, larger birds are easier to potty-train than smaller birds. Either way, you will need to be consistent and patient. Your bird will learn where his potty place is. The easiest way to potty-train him is to leave him in his cage or on his perch until he poops. As soon as he goes, say the key phrase you want to train him to, such as, "Go potty," and give him lots of praise. Take him out of his cage or off his perch and spend time playing with him. When you know he's getting close to having to go again, put him back on his perch or in his cage and repeat the process. In a matter of a couple of days, he will begin to associate his potty place with the desired behavior. Some birds will eventually learn to return to their perch or cage on their own, go potty, and return to you. Talkers may amuse you by saying their own key potty phrase when they go.
Once your bird has been trained to potty in a particular place, you can begin teaching him to hold his bowels until it's appropriate for him to poop. You can accomplish this by keeping him away from his potty place for longer and longer periods of time. Increase the time periods gradually, and be sure to lavish him with praise every time he makes it back to his potty place without an accident. If you see the telltale signs that he is going to poop, say "no" and try to interrupt the behavior. Immediately return him to his potty place. Even a trained bird will have accidents from time to time, and a young bird can't control his bowels until he is around a year old. Never punish your bird for having an accident. Your training will be far more successful when it is based on praise for positive behavior.