To be convicted of Brandishing a firearm, the prosecution must prove that you
Pointed, held, or brandished
a firearm, gas operated weapon, or something that looks like a firearm
in a public place
in such a manner so as to reasonably induce fear in the mind of another of being shot.
You can find the actual words of the statute here Va. Code 18.2-282.
If the prosecution can convince a judge that you did all of the things list above, you can be found guilty of a class 1 misdemeanor. There are more serious consequences for brandishing a firearm near a school.
You probably noticed that you can be charged and convicted of brandishing a firearm even if you weren't brandishing an actual firearm. If you brandish a toy gun that appears to be a firearm and you place others in reasonable fear, you can be convicted.
Va. Code 4.1-100 defines public place:
" 'Public place' means any place, building, or conveyance to which the public has, or is permitted to have, access, including restaurants, soda fountains, hotel dining areas, lobbies, and corridors of hotels, and any highway, street, lane, park, or place of public resort or amusement."
To reasonably induce fear in another means that an average person would find your conduct scary. So if a person is extra sensitive to firearms, that would not be enough to be found guilty. The judge will have to determine whether a reasonable person would have been in fear.
Yes. If you reasonably fear for your own safety or the safety of another, you can brandish a firearm to protect yourself or others. You can also brandish a firearm to protect your property from intruders. However, brandishing a firearm is different from shooting a firearm. There are situations where you can brandish a firearm, but you could be in trouble if you actually discharge the firearm. You should also know that just because you believe you're justified in drawing a weapon does not mean that you won't be arrested and charged with a crime. Once that happens, you will have to go through the stressful and costly criminal justice process.
All of this is to say that you should not assume that you understand the situations where you can draw a weapon on someone and situations where you cannot.