More formal:
* It defecates.
* It excretes waste.
* It has bowel movements.
* It relieves itself.
* It discharges its bowels.
More informal:
* It goes to the bathroom.
* It does its business.
* It takes a dump.
* It drops a deuce.
* It leaves a present.
For specific animals:
* Dogs: It goes potty.
* Birds: It lays a dropping.
* Cats: It uses the litter box.
For babies and toddlers:
* It has a dirty diaper.
* It needs a change.
For young children:
* It goes pee-pee and poo-poo.
Remember to choose the appropriate word or phrase based on the context and who you are talking to.