This is a dominant behaviour that can be a foreshadow to problems in the future. Be sure to nab it right in the butt.
Usually for dogs that go through that stage, they get squirt on the butt with a water sprayer. With a firm NO it works everytime I find. Be sure to reward them for positive behaviour all the time though too! Simply a dog lying at your feet should be rewarded!