The tiny breeds, like chihuahuas, take longer to house train than larger breeds. At 4 months, he still has time to get the idea. I personally hate the idea of the pads or any other item that lets your dog think that eliminating in the house is okay. I really don't think they can easily grasp the idea that the pads are okay but the rug is not. They need to learn that outside is the place to go and that they must tell you when they need to go out. Use the natural reflex of "eat then eliminate" to help in your training. Don't "free-feed" while training, including access to water. And if you know you're going to have to leave him in the crate/pen while you go out, dramatically limit any food and water your dog has access to during that time. Give a toy or a chew to occupy his mind while you're gone, a few bits of kibble and an ice cube or two. If he fills up early, he'll need to go potty soon and he'll have an accident.
I'm a firm believer in crate training. Dogs need a place they can go when you need to limit their access to the rest of the house (when you're not there or when there are people over) but to also go when they feel the need to get away and be by themselves. For a small chihuahua, the crate needs to be small enough so that they aren't tempted to eliminate in it, but large enough where they can be comfortable but secure.
Positive reinforcement is the best way to train a dog to do anything. Work starting with small steps, lavishing the praise ONLY when they do something correct. Negative reinforcement only works when you catch them in the act. Never hit, but a firm "NO!" should be used followed by either ignoring him or telling him what the proper behavior is. Learn the difference between attention-seeking behavior (purposefully misbehaving) and actual mistakes in behavior due to ignorance. If you do ANYTHING to your dog when he's barking in his crate or pen, you are supplying positive reinforcement for that improper behavior. You must learn to ignore him until he becomes quiet and behaves, THEN give him the attention he wants.
You are the boss and he must not only learn what to do and what not to do from you, but also that you will remain the boss and he will always be the low member of the pack. An obedience class for puppies will help you a great deal, as well as adult classes when the time comes. And don't forget to socialize your pup with not only other animals but with other people and different places. You don't want to create one of those "pocket-piranha" Chihuahuas that everybody hates.