While some children self-soothe through auditory, olfactory or taste sensations, many are comforted by tactile sensations.
Your son is probably enjoying all the attention he's receiving through this behavior, whether it's positive or negative. If this is the only type of sensation he seeks, it's probably a replaceable behavior, which means you can substitute one soft sensation for another.
Consider letting him choose either a silky blanket or a soft, stuffed toy. Show him how he can rub these objects between his fingers when he needs to calm himself as he does with your legs. When he tries to go for your legs, hand him the toy and simply state, "Not legs. Toy." When he switches to the toy, positively reinforce that behavior by telling him, "Good!" Often within hours to days, the switch becomes permanent -- although it may need intermittent reinforcement.
Expert Section | Expert Section | Expert Section | Expert Section | Expert Section | Expert Section | Expert Section | Expert Section | Expert Section | Expert Section