My little beagle likes to play with me but I don't know if he wants me to play with me or just wanting to go to the toilet? Last time he was scratching my leg and I thought that was a bad attitude so I put him in his cage but a few minutes after that he peed! He actually knows where to pee and poo but I can't tell whther if he wants to do something or not! If I keep having this bad habit he might ad well start to pee in his own cage even when he can't get out! What is the difference?
You don't want him to scratch your leg and you don't want him to pee. The best thing is to follow the directions in the housebreaking book about when to take him out. Also watch him carefully and he may give you some other indications of needing to go. If you think he needs out, take him.
The next time he scratches you, tell him "No." When he backs off, tell him "Good dog." Then ask him if he wants to go out. Yes, I know he doesn't understand the question yet and couldn't answer if he did, but, while asking, you take him outside. If you always use the same words, and praise him if he does something outside, he will learn what you mean. (Actually, he will learn you mean he gets to go outside when you say those words. But he will want to go out when he needs to.)