Before a bird can be "potty-trained," he should be familiar with the "step-up" command. Just as the bird begins to defecate, give a verbal command, delivered in a quiet, pleasant voice. Say "good bird," open the cage and take him out for some quality time and maybe a treat. After about 10 to 15 minutes, place your bird back in his cage and wait again. When he begins to "go," say the command, praise him and take him out of his cage for more playtime and another reward. After a few of these sessions your bird will begin to catch on.
For more information, please read the story Potty-Train Your Parrot: As Easy as 1-2-3.