A rabbi and three other congregants were held captive by a gunman for 11 hours before escaping.