In general I (a male) will hold the door open for anyone with me. However, my rules are complicated!
If I am walking with a man, and the door opens towards me I will open it, and gesture for them to go through (Diagram 1 pt. A). Eye contact is important here. If they gesture back I will do as they indicate, and continue through - a back and forth in a doorway is not my idea of fun. I will walk through a door which opens away from me then hold it for them (Diagram 1 pt. B).
If I am walking through a door with a woman, I will hold the door open and gesture to them whichever way the door opens. (Diagram 2) Again, eye contact is a must. As with walking with a man, I will never get into a “gesture fight”.
If I am walking with a group of just men, or a mixed group I will follow the same rules as I do when waking with one man. In the door towards me situation, I will walk through only when one member of the group gestures for me to. In the door away from me situation, I will walk away when the next person is holding the door (Diagram 3).
If I am walking with a women-only group, I follow the same rules as with a single woman - I will still avoid getting into a “gesture fight”.
If I do not know the gender of the individual, I will default to the rules for female companions.
If the door is an automatic door with a button, the gender of the companion, the size of the group, and the direction of the door are irrelevant. I will press the button, then follow the same sequence as with one woman (Diagram 2 pt. A - without holding the door of course), or mixed group.
If there is a person not waking with me, but just behind and I know they are walking through the same door, I will hold it if they are less than 4 seconds behind.