If your flooring sheet is not inclined towards curliness, staplegunning works ok. (Try to angle or stagger the staples so you are not creating a "perforated line" at the edge of the sheet though).
My preference is to use staples to get it tacked well in place, then screw through metal or wood battens with silicone caulk underneath them (all around the edges, and on any seams on the floor). Any caulk protruding from crack is struck off flush, so all it's doing is occupying the space under the batten so mites can't. This seems to last better for me than just staples alone (which I do have, and it seems to get curly-uppy around the edges after a while, alhtough maybe this is just me and my particular vinyl)
I would not personally put it down under the bottoms of the walls (i.e stapling it down before putting the walls on)... it will make it impossible to fully replace if that's ever necessary, and may create a conduit in which water can wick in from the outside to get trapped between vinyl and plywood and start rotting things out.
Good luck, have fun,
Pat