IMO, factory NIB means: the original factory box, sealed; the original gun, in factory cosmo/oil and bagged; the original spent cartridge; the original tester's document/tag; the number/type of magazines and other items shipped from the factory; and no signs of wear and tear once you open everything up.
Anything else is basically "used." Though, of course, there are many levels of "use," from simply having an opened box, to a "safe queen" that's been shot only a handful of times, to something well-worn from years of carry (ie, a police trade-in, in a department known for its heavy training schedule on its duty weapons).
If you're really wanting to ensure a legitimately new NIB gun, then I'd suggest shopping at a known quantity. Find a shop that everyone swears up and down is a great shop, an honest shop, one that has earned that reputation over the course of many years. Only buy where you're able to inspect everything ahead of time, including the original box/documents/spares. If you really want to have a level of certainty above and beyond that, only shop at a place that allows something like a 3-day no-shoot guaranteed return policy. Though, most of us settle for far less than that, as our experience allows for greater comfort level with situations. No telling when you're getting snowed on some level. Though, outright wear and tear can be easier to spot. And it's simple enough to come to a shop well prepared, by knowing exactly what you should be seeing in a "factory NIB" box. JMO.