What does ants in your pants mean?

If someone has ants in their pants, it means they are excited, agitated or worried and can't keep still.

For example, "She has ants in her pants because she is going to Europe tomorrow." means she is very excited to go to Europe.

"John has ants in his pants because his teacher wanted to speak to his mother." means that John is worried as his teacher is speaking to his mother.