mosfet terminal identification
First you have to realize that a MOSFET is a 4 terminal device, Source, Drain, Gate and Body/Bulk.  Here is a very simplified cross section of a NMOS transistor:


Notice this picture that the Source and the drain are indicated by S/D. That is because which one is which is determined by operation/connection. The diodes are the junction diodes formed by the S/D implants (N-type) in a P-Type substrate.  From this you can see that the S/D's must always be reverse biased or else the diode turns on and function is lost.  The bulk is connected either through the backside or through a same type implant on the front (labelled "body contact" here)

Here is one probable way that your NMOS is connected internally:


Because the Left hand side S/D is now connected to the bulk/body it becomes the source.  You need to get the heat out of the die so you might as well use all that area on the backside to connect to (labelled "back-side contact").  Since Source is simply connected up on the surface there is no need to bond wire it to the package pins like the Gate and Drain.  Notice that the Left hand side diode formed from the Source to bulk connected is now shorted out with the Metal bridge - it disappears.  You now have the three terminal device that you are using.

Now that you have an understanding of what is going on it's straight forward to determine the package pins.  Note the gate will be a capacitor and the S-D connection is a diode.

Digital Multi-meter set in diode mode.  Pick a pin with one probe, and then probe one of the remain other ones.

1) If it reads a diode (but doesn't change) then you have found S and drain right away.  Other pin is gate.

2) if it reads open (and doesn't drift) then you have found S and D right away but in reverse bias.  Switch leads on pins and follow instruction from #1.

3) If you can't get a stable reading then one of your probes is on the gate is the meter is slowly charging the gate capacitance.  Change one of the leads and then the other until you see either 1 or 2.

Note: there might be a few devices that this doesn't work on for other reasons.  But you should be able to work you way through it.

A simplified version of this test is to "keep changing pins until you find a stable ~ 0.8 voltage diode drop when in diode mode" there is only 6 configurations to test.