It is simply counting first the total number of pilot truck wheels, followed by the total number of coupled driving wheels, and if there is a trailing truck, the number of wheels on that truck.
So, a yard switcher with no pilot truck and no trailing truck would be designated as a 0-8-0 if it had four coupled drivers on each side of the frame. A Pacific Class had the designation of 4-6-2. And so on.
Note that in Europe, say in France, they do not use the Whyte Notation, but use a half-Whyte Notation. They only count the truck wheels and drivers on the one side visible to the viewer. So, a Pacific Class (and they don't use that name, either...) would come out to a 2-3-1.
-Crandell