Lane Positioning and Sharing the Road
Three positions, no single right answer
Think of a lane as having a left, center, and right third. Each has advantages: the left third can make you more visible in the mirrors of cars ahead and gives you an escape path away from parked cars; the center is where you may be seen best by oncoming traffic but is also where oil drips collect, especially at intersections and in the first minutes of rain. Choose the position that maximizes your seeing and being seen, and change it as conditions change rather than settling into one spot out of habit.
Space is your safety margin
Keep at least a two-second following distance in good conditions and add a second for each additional hazard: rain, darkness, gravel, a heavy load, or a large vehicle that blocks your view. Never ride in a car's blind spot; if you can't see the driver's face in the mirror, assume they cannot see you. Do not share a lane with another vehicle - motorcycles are entitled to a full lane. Lane splitting rules vary by state, and in most states riding between lanes of moving traffic is illegal. When being passed, hold your position and speed; do not drift toward the passing car.
Traps and rule of thumb
Questions often claim the center of the lane is always safest, or that a motorcycle may share a lane with a car in heavy traffic. Both are wrong. Rule of thumb: if you have no escape route, change your lane position until you do.