“Code P0050 -ho2s Heater Circuit Bank 2 Sensor 1” tell you EXACTLY which O2 sensor it is.
http://www.shipkiller.com/O2-Sensor_...eshooting.html
In a BMW and most other cars with four (4) O2 sensors, these sensors are labeled. You have 'upstream' sensors, O2 sensors that are between the engine exhaust manifold and the Catalytic Converter(s) . You also have 'downstream' sensors, O2 sensors that are after the Catalytic Converter(s).
On BMW's six cylinder engines, there are two "banks" of cylinders. Bank 1 is cylinders 1-3 and bank 2 is cylinders 4-6.
The upstream O2 sensors are labeled B1S1 and B2S1. Bank1, Sensor1 and Bank2, Sensor 1 respectively. The downstream sensors are B1S2 and B2S2.