That code is often set by a small exhaust leak. Extra air is drawn in on the O2 sensor. Yes, air can get in - the exhaust pulses and creates a vacuum between pulses, drawing the fresh air in.
Night or dark garage - have a helper spray WD-40 or a light oil in the throttle body while you get underneath with a bright pencil beam flashlight. You'll see a wisp of smoke coming out the leak.
Another reason the code sets - the O2 heater wire is disconnected or broken.