Does the following sound familiar?
"It's OK when my dog jumps up on me when I get home after work, but he also jumps on my guests, or he jumps on me after coming inside from the rain and his paws are muddy! How do I teach him when it is and isn't OK to jump?"
Or how about this one...
"Sometimes I like to play rough with my dog, but sometimes I want him to play gentle and he nips and bites! It's also embarrassing when he plays too rough with other dogs at the dog park and they yelp in pain. How do I teach him when it's OK to play rough, and when he should play more gently?"
The short answer: You can't.
Dogs are not reasoning creatures like humans. They do not understand "sometimes" and "maybe"