As Allison Bailes writes in this recent Energy Vanguard post, because building assemblies like walls and roofs are three-dimensional, a decision has to be made about whether the air barriers belongs on the inside of the assembly, on the outside, or someplace in between. Factors that affect this decision are the climate, the type of insulation, and the presence (or absence) of buffer spaces, such as crawl spaces and attics. This is a good review of a complex topic (be sure to check the Comments section too).
Bailes writes: In the end, you want a house to have the best possible air barrier it can have. It should be protected from damage, aligned with the insulation, and exclude buffer spaces you don’t want inside the building enclosure. And then you do a blower door test to find out how airtight the house is.