Coupster's method is spot on. I've found that it is a bit easier to insert the fork into the head tube with the race seat touching the bottom. Then all you have to do is measure the length of the steerer tube protruding from the top. You want a bit of room between the steerer tube head and the lock nut so subtract about 2 mm and you are in business. As others have said, you can always add spacers if your stack height is a bit low.