To use the potentiometer as a voltage divider, all the three pins are connected. One of the outer pins is connected to the GND, the other to Vcc and the middle pin is the voltage output. When the potentiometer is used as a voltage divider, the wiper position determines the output voltage.