The upstream oxygen sensor is located in the exhaust manifold, and the downstream oxygen sensor is located in the exhaust pipe.
The upstream oxygen sensor is the one that is used to control the air/fuel mixture, while the downstream oxygen sensor is used to monitor the efficiency of the catalytic converter.