Ask their MOS. A real military person will probably respond with a number/letter combination, such as 11B or 92G...
Ask his rank. If he says he's an E-7 Master Sergeant, he's lying. E-7 is a Sergeant First Class...
NOTE: This information is based on the United States Army. Certain details will vary by other branches of the military and nationalities.
Yep, what is true for the U.S. Army isn't necessarily true for other branches of the U.S. military.
If you are in doubt about a person's alleged military credentials, then talk to a military recruiter who is in the same branch of the military.