It was originally done with 3 hall sensors, now the normal way is commutation tracks on the quadrature encoder, in some cases it can be done by the controller initially exercising the motor and using quadrature and current feedback to locate the field positions, from then on the encoder is used to commutate.
Max.
If using the encoder, then you need to initially find the relative position of the poles by exercising the motor initially to do this, then you also need to know or find the pole count.
Then the encoder position is used to commutate, I have not used this method personally but some drive manuf. have.
Search Microchip site, they have a few examples of BLDC motor control.
Max.