This rule is frequently misunderstood or ignored, and many people have drafting problems with their fireplaces because of that. This rule is fairly simple, and must be followed in every vented fireplace installation.
National Fuel Gas Code, ANSI Z223.1, Section 10.5.2.1, states the rule: "A chimney for residential-type or low-heat gas utilization equipment shall extend at least 3 ft. (0.9 m) above the highest point where it passes through a roof of a building and at least 2 ft. (0.6 m) higher than any portion of a building within a horizontal distance of 10 ft. (3 m)."
The basic rule is this: the bottom of the vent termination must clear the roof penetration point (the upper edge) by at least 3 feet; further, the bottom of any fireplace vent termination must clear anything within a 10 foot radius by at least 2 feet. This includes: the peak of the house, parapet, dormer, chimney, or spire. The following diagrams illustrate this rule.
1) This image (though not exactly to scale) demonstrates that the flue terminates 3 feet above the highest penetration of the roof. It also clears the ridge of the roof by 2 feet, since the peak is within 10 feet of the flue termination:
2) If the flue terminates beyond 10 feet from the ridge of the roof, the flue must simply clear the upper penetration of the roof by 3 feet. Notice that the flue still terminates 2 feet above the roof at the 10 foot perimeter:
3) In a flat-roof installation, the flue penetrates the roof more than 10 feet from the parapet. It terminates 3 feet above the penetration point, without regard to the height of the parapet:
4) In this flat roof example, the same rules apply. In the diagram below, the flue on the right terminates within 10 feet of the parapet, so it must terminate 2 feet above the parapet height, as in Diagram B above. Notice the left flue on the neighboring building: it also terminates 2 feet above that same parapet, since it is also within 10 feet of that parapet: