Official rule text as published in the U.S. Coast Guard Navigation Rules
(a) When two sailing vessels are approaching one another, so as to involve risk of collision, one of them shall keep out of the way of the other as follows:
(i) when each has the wind on a different side, the vessel which has the wind on the port side shall keep out of the way of the other;
(ii) when both have the wind on the same side, the vessel which is to windward shall keep out of the way of the vessel which is to leeward;
(iii) if a vessel with the wind on the port side sees a vessel to windward and cannot determine with certainty whether the other vessel has the wind on the port or on the starboard side, she shall keep out of the way of the other.
(b) For the purposes of this Rule, the windward side shall be deemed to be the side opposite that on which the mainsail is carried or, in the case of a square-rigged vessel, the side opposite to that on which the largest fore-and-aft sail is carried.
MyCOLREGS explanation
Rule 12(a)(i): wind on different sides - the port-tack vessel keeps clear of the starboard-tack vessel.
Rule 12(a)(ii): wind on the same side - the windward vessel keeps clear of the leeward vessel.
Summary
When two sailing vessels are approaching each other with risk of collision, wind position decides who keeps clear. If they have the wind on different sides, the boat with the wind on her port side keeps clear. If they have the wind on the same side, the boat to windward keeps clear of the boat to leeward. If a boat with wind on her port side spots another vessel to windward but can't tell for certain which side the wind is on for that other vessel, she should keep clear anyway rather than guess. Windward/leeward is measured by which side the mainsail is set on (or, on a square-rigger, the biggest fore-and-aft sail) - the side opposite the sail is the windward side.
Real World Example
Because neither sailboat can be forced to stop or throttle back, this call has to be visual and instant - a glance at where the other boat's boom is sitting tells you her tack, and on different tacks, that alone decides who keeps clear. On the same tack, the logic runs the other way: the windward boat can bear off and gain speed to get clear, while the leeward boat is already sailing as close to the wind as she can, so forcing her to alter course risks stalling her sails right when she needs to maneuver.
Practice Questions
Q1. Two sailing vessels are approaching with risk of collision. One has the wind on her port side; the other has the wind on her starboard side. Under Rule 12(a)(i), who keeps clear?
A. The vessel with the wind on her starboard side.
B. Whichever vessel is smaller.
C. The vessel with the wind on her port side.
D. Whichever vessel is to leeward, regardless of tack.
Q2. Two sailing vessels both have the wind on their starboard side (same tack), approaching with risk of collision. Under Rule 12(a)(ii), which vessel must keep clear?
A. The vessel to windward.
B. Neither - both hold course since they share the same tack.
C. Whichever vessel arrived at that position first.
D. The vessel to leeward.