Let's face it; babies never stop moving unless they're asleep. Dressing them is a hassle unless you distract them.
Don't give them something that will get in the way. If the baby is about six months, or can hold things by itself, then hand it a toy. They usually stop squirming and focus on the new toy.
If the baby is older, give it a tooth brush. Babies tend to want to be independent, so when they brush their teeth they normally become absorbed in the toothbrush and stop trying to get away. Put a little tooth paste on it and you've bought yourself time.
Hurry. Don't go too fast, but don't be a sloth or the toy will become boring and they will lose interest and squirm again.