Under what circumstances may there be gaps in an 'Eiruv enclosure: how many can there be, and how large can they be?
An opening is not considered a breach if it is either
- less or equal to 10 amos or (SA OC 362:9)
- is set up as an opening with (minimally) 2 posts and a crossbar or as a gated structure (OC 362:11)
However, the entire enclosure must not be mostly open (OC 362:9) (with the exception of eiruvei tzuras hapesach, see below) and the walls must be defined (you cannot have an entire wall missing just because it's less than 10).
According to the Rosh, if the enclosure is surrounding multiple living quarters where many openings are common, the community may surround their area with posts and crossbars even if the area will be mostly open. The Rambam only allows posts and crossbars if the area is mostly closed (OC 362:10).
I had lived in a gated community which had an electronic gate at the enterance, but the opening was larger than 10 and it had no crossbar. My Rav told me that the gate is a tzuras hapesach. The crossbar just makes it a tzuras hapesach even without a gate.
If the majority of the enclosure is gaps, it is invalid unless each gap is less than 3 tefachim wide. (OC 362:8)
If the total amount of wall is greater than or equal to the total amount of gaps, it is kosher provided that there is no gap of more than 10 amot which is not closed using a tzurat hapetach (lit: form of an opening, it is two vertical posts with a horizontal one across representing a doorway). If the area enclosed is not residential but is rural, then a tzurat hapetach is only effective (to consider it closed for calculations of the majority) for gaps below 10 amot. (OC 362:9-10)