I used this method. My dog used to get so rough that I was concerned that he was going to hurt someone.
Adding to it, when play stopped, I turned away and ‘sulked’ because body language means so much. Also, I added in a toy for tug of war, and whenever the play escaped the toy I said ow and play was done.
This took a few months to really sink in for the dog, but we got to the point where he would play, we would say to get a toy, and there was no more leaping for limbs.
Some long time later, we were to the point where I could hold his teeth for gentle tug of war, but he decided he didn’t like my skin in his mouth.