Generally, an exclamation of extreme frustration.
Specifically, an exclamation of extreme frustration when you made the wrong choice based on insufficient or faulty information, usually said of something trivial like getting the wrong snack out of a vending machine.
Ah, man! I ordered the deluxe platter and it turns out it's a fuckin' veggie burger and a soy-based milkshake. God God Dammit Dammit!
She told me over the internet that she was a virgin, and I was all excited, but it turns out she's also really ugly. God God Dammit Dammit!