It could be nightmares / night terrors. I think my daughter had some "bad dreams" fairly young. She didn't scream out like your son, but sometimes she would cry a bit, but by the time I got to her she'd be back to sleep! Now that she is 4 I can ask her about her dreams. Sometimes she's told me that she "didn't get her wish". I think she must have gotten that from a story or a movie. Another time I think she told me that I didn't let her have her cookie! So, even little things can upset them in their sleep. Friend stole a toy, lost a toy, remembering a time he got upset when you left, etc.
Unfortunately, I'm not sure what you can do other than go in & pat him on the back & try to calm him. Hopefully it's a phase that will pass soon!