My first question would be ... how old is your puppy? Is he really housetrained yet? You can't train a puppy to ask to go outside to potty until he really understands where he's supposed to go - so that's the first order at hand. Not sure if I missed a thread someplace where you've intro'd yourself and your puppy, age, etc - my apologies if I have. Is he fully housetrained? If not, that's where you start. How old is he? A regular potty schedule, often depending on age, is a good place to start, getting him outside regularly, as suggested above, and throwing a big party when he does his business outside. This takes time and patience. Young puppies have so many things to learn in this life, barking to go outside should be the last thing they need to worry about. And as suggested above too, you may want to re-think that barking idea - or you may have a dog who never shuts up.

Bells at the door, or a dog who paws you, or comes and stares at you, something besides barking, may be a better idea. Until a dog starts to mature, it's up to the people to stick to a potty schedule and make sure they get outside lots, and as often as necessary, so hopefully accidents in the house can be avoided. If a puppy has an accident, it's OUR fault, not theirs - it means WE didn't get them out in time - so it means more attention needs to be paid to how YOUR dog tells you he needs to go outside. And as also stated above, each dog will develop their own way to tell you, you just have to learn to "listen", learn to read your own dog. It's a two-way communication between you and your dog. They learn to read us so well, but we must also learn to read them.
If you have any questions about how to housetrain, or if you're having trouobles in that area, please feel free to ask.