Obviously, make sure it is in the original box with original packing materials and manuals, warranty cards, etc. Missing these would be the first and most obvious sign, though they can be had from the manufacturer usually for free if they are missing.
It will have been test fired at the factory at the very least, so expect some signs that it has been fired. Look at the flash hider for excessive fouling. There will be some, but not much. Also just look over the rifle for general dings that would come from living in a safe or shelf or being carried around, even without firing. Some light scratches are normal for NIB, deeper ones are not and certainly nothing that would show bare aluminum.
The Bolt locking lugs, bolt carrier, cam, charging handle and the corresponding inside areas of the upper receiver should still have most of the original finish present, not worn away through repeated use. The rifle would have been actuated several times during final assembly, then again during test fire phases of manufacture, but nothing more than that unless the gun was sitting on some dealer's shelf and fondled a lot by tire-kicking customers.
It's very subjective, but just keep an eye open for wear that falls outside of test firing or shipping the firearm. As long as the gun works, don't worry about it.