I can't say i have done extensive tests on this, nor that this is something have used to great extent, but from my limited experience, the game engine reads the code like this:

(building or unit) requires ( factions { blah, blah,} AND a AND b AND NOT c ) OR ( d AND e AND NOT f ) OR ( g )

I haven't done any tests with this bit exactly, but I would be pretty sure that that's how the game reads it.

Dark89