Based on time of day and place, I'm guessing he was waiting for his intended target to emerge from the building after work and walk to the Metro station. After waiting a while, he blew a gasket, pulled and fired at the security guards.
If it’s the same guy, he mentioned Petraeus in one of his rants.