This method is intended for steel-string acoustic or electric guitars, and is not designed for classical guitars’ horizontal tuning pegs and nylon strings.
This time, your string should pass under the loose end.
This might be a good time to mention that it takes practice judge how much slack you needed to start with so you’d have just enough to finish the wrap and tune the string. If you don’t have enough string, just back up and try again with a little more slack to start.
Leave about 3/4-inch of the string sticking out from the machine head so that you can bend the ends of the strings back on themselves (needle nose pliers help a lot). Anyone who’s ever gotten the tip of a guitar string accidentally jammed under their fingernail knows why this is helpful. This method has the advantage of reducing the amount of string used to make a secure wrap, thus reducing stretching and break-in time. (Plus, you don’t have to do as much winding and there’s no ugly masses of string on your machine heads. )