This is a way to report one person's commands or requests to another person:
He said to wait for him.
This means that someone told you "Wait for me" or "Could you guys wait for me?" or "Hey, don't leave without me, OK?"
Here's another example: imagine that you're a child. Your father told you "Don't talk to strangers!" Now your brother is about to talk to a man who he doesn't know, so you remind him of your father's words:
Daddy said not to talk to strangers.
So you can see that the pattern for negative sentences is "(someone) said not to (do something)".