When scolding your dog for doing the toilet on the carpet remember that we were once young and did not use the proper toilet either. Your dog needs to be house trained, and this can be done in a few easy steps, but over a long period of time.
Dog house training may be one of the hardest training techniques as it is the one that requires the most attentiveness and work. You have to be able to read your dogs body signals as he cant tell you when he needs the toilet. Many people make the mistake of assuming that their dog will bark when he needs the loo, sometimes they are lucky to find a dog that will but believe me there are many out there who dont and accidents are found all over the house!
Dog house training requires a few simple steps as I said but they are time consuming ones. Firstly I would recommend putting newspaper in front of the door, that way if you see him doing an accident in the house you can quickly life him there and he will realise that if he needs to go and your not there to let him he has to do it on paper.
The next thing you need to know when dog house training is most dogs when they need the toilet will start to get restless and stat sniffing around, this is when you pick them up and take them outside, when they are really young you should take him outside at least once every hour. When you take them outside you can say things do the toilet or do your business or whatever command you want to use for your doing going out to do the toilet. Once they have done the toilet you must give them lots of affection outside straight away (of course its best to wait until they are done) They will soon come to realise that outside is the place to do the toilet and will after some time start asking to go out.
There are hundreds of books available on dog house training all of which use different techniques and routines. No dog is going to know straight away that outside is the place to do the toilet, they have to learn and you have to teach them (unless you dont mind accidents all over the place) Oh and dont forget to scoop!!