Castiel is capable of opening a gate to a location he has been to, at least, once. He merely has to think of the place. Though, this does not always mean that the people will be teleported to a safe spot. Anyone he permits can walk through that gate, and only those he allows, to the destination intended. Castiel can only open the gate when he sacrifices something important to him. It can be anything of personal value: his blood, one of his emotions, an item he holds dear, a beloved animal, whatever he considers of personal value. The more valuable he considers something, the longer the gate will stay open.