You have to be consistant with potty training. Ask him if he has to go out, then take him out and tell him to go pee pee. Be patient. Give him time. If you don't want him barking at strangers, let him get to know them. Let them give him treats. Tell him it's ok. He's doing what comes naturally thinking he's protecting you and his home.
You'll have to keep a close eye on him during potty training so he doesn't go anywhere other than where you want him to go. They always have to potty about 15 minutes after being fed. If you see him start to look for a place around the house, take him out immediately and most important, Don't forget to praise him when he goes where you want and does what you want. He's confused right now as to what's right.