Sheena's answer is right.
You're expressing two separate ideas: "They left the house in a hurry" and "They forgot to turn the lights off." To connect these ideas, you need to use the structure "such ... that ..." This structure shows that one thing caused the other.
"They left the house in SUCH a hurry THAT they forgot to turn the lights off."
The same rule applies to the structure "so ... that ..." For example, "He was so angry that he started throwing things." "We arrived so early that the store wasn't open yet."
Use "so" with adjectives and adverbs ("so happy," "so old," "so many," "so quickly") and "such" with nouns ("such a disaster," "such a strange idea," "such a large house").