What we're talking about here is the binomial distribution.
The probability of getting exactly 50 heads is the product of the probability of one way of getting exactly 50 heads (0.5 raised to the power 100) and the number of different ways that 50 heads can come up (100 choose 50, or 100!/50!50!). Many calculators have a binomial coefficient function (sometimes called the number of combinations).
If I input the numbers into my calculator correctly, I got a probability of slightly less than 0.08.
Added by edit: Oops, I misread the numbers. That's 500 heads out of 1000 tosses. And reading Percy's comment more carefully, he already got this. My apologies.
Edited by Chiroptera, : No reason given.
I believe in a relatively equal society, supported by institutions that limit extremes of wealth and poverty. I believe in democracy, civil liberties, and the rule of law. That makes me a liberal, and I’m proud of it. -- Paul Krugman