It is very normal for puppies to naturally prefer to eliminate on something absorbent — like grass, for example. Puppies are too young to know that it’s not okay to use the rug, and the fact that he is making an effort to get to an absorbent surface is actually a good sign.
Take him outdoors more frequently. He may still be too young to physically control his bladder. Give him treats and a lot of praise when he successfully goes to the bathroom outside.
Watch carefully for signs that your puppy needs to relief himself: circling, stopping what he’s doing and purposefully heading to another part of the house, or sniffing are just a few examples. If you see any of these signs, take him outside, but try not to let your pup get to that point. Right now, it’s better to set him up for success by taking him outside before he starts to look for a place to go. It could take several weeks to successfully housetrain your puppy.