When two boats meet on opposite tacks, the one with the wind on its port side keeps clear. The windward/leeward rule only kicks in once both are on the same tack.
Three principles cover most encounters, and their order is what matters: port keeps clear of starboard, then windward keeps clear of leeward (overlapped, same tack), then, when the boats are not overlapped, the boat clear astern keeps clear. You read your own tack off the side your mainsail sits on: main out to port means the wind is on your starboard side, and you hold right of way. The most common error is applying windward/leeward when the boats are actually on opposite tacks — the tack rule wins. And the point that gets lost in a crowded start: right of way is not a licence. If a collision is clearly developing you must act to avoid it, even when you are in the right. Hail early and loudly, keep distance while the situation is unclear, and sail defensively when in doubt — these rules are collision avoidance first and a sport rulebook second.