No dog shall be declared a dangerous or potentially dangerous dog if:
1. The dog was used by a law enforcement or military official for legitimate law enforcement or military purposes.
2. The dog was protecting or defending a human, offspring, or another animal, within the immediate vicinity of the dog, from an attack or assault.