[verb て-form] + いる + 間 [verb (dictionary form)] + 間 [noun] + の + 間 [na-adj] + な + 間 [i-adj] + 間 [noun] + と + [noun] + の + 間
間 means "while" or "during": the main clause goes on for the whole of the stretch that 間 marks. A verb in front of it is a continuing action in the ~ている form or a state such as いる; a noun takes の, a な-adjective な.
間 alone means the main action fills the whole period, so the main verb is usually a continuing one: ~ていた, often with ずっと. ま間に puts a single event somewhere inside the period.
With two nouns joined by と, 間 means "between", in space or in time. Where something is takes に.
These go beyond "while" and "between".
間 also covers a relationship, or a group of people something is known among.