Buck converter simulation issues
If you simulate a synchronous buck converter then the two switches (yes, there are two in a synchronous buck converter) are wired like this: -



Picture above from here.

If SW1 is on then SW2 is off and vice versa. This means that the average output voltage is the input supply voltage (12 volts in the example above) * duty cycle. In the picture above the duty cycle (as a fraction) is: -

$$\dfrac{5}{12} = 41.667 \text{ %} $$

And that leads to an average output voltage of 5 volts. The inductor and capacitor on the output smooth the PWM waveform to a (hopefully) low ripple DC voltage of 5 volts.


  I can’t figure what how to control the nmos with pulse width
  modulation


Use a voltage generator source (set as a square wave of the appropriate duty cycle) to drive the MOSFETs (or switches) just to get a feel for it. Following that, you can develop a PMW signal source based on an analogue input but make sure you get the basics right first.

This usually involves a comparator fed with a reference triangle wave like this: -



Circuit from here.

But you can use an LTSpice voltage source set to produce a triangle wave if you wanted and just use the comparator indicated by U1c in the above.