Sounds like he needs to be potty trained. Just because you take him out side does not mean he understands that is where he is supposed to go. You could try clicker training , it is a great way to teach where to go.
https://www.youtube.com/watch?v=QvPiFcG7ROI
https://www.youtube.com/watch?v=QvPiFcG7ROI