How can someone share 50% of their DNA with their parents yet all humans share 99.9%?
It will be clear with a simple analogy.

You are 50% related to any one of your parent

Let's say you don't have any biology books. You have two friends, Alice and Bob. They each give you a copy of the book Campbell Biology. You now have two Campbell Biology. You have received 50% of your Campbell biology books from Alice and 50% from Bob.

Similarly, you inherit 50% of your DNA from your mother and 50% from your father. You are related at 50% to any one of them.

Two randomly sampled individual are 99.9% identical 

Now consider the list of all the copies of Campbell Biology in the world. As there exist different editions, all Campbell Biology won't exactly be the same. 
Let's say you randomly sample two Campbell Biology from around the world and you align them letter by letter. What is the expected fraction of the letters that will be identical? If, for example you find the two sentences


  Selection is a fitness variance associated to a genetic variance among individuals in a population.


and 


  Zelection is a fitnezz varianze azzociated to a genetic varianze among individualz in a populazion.


There are exactly 9 mismatches out of 99 characters, that is a 90% similitude.

Similarly, if you randomly sample two humans, align their DNA (a DNA sequence look like ATTTCGCTGTCGAATCGATCGGTA), you'll find that the fraction of mismatch is lower than 0.1%. Therefore, we all share 99.9% of our DNA.

Of course, alining DNA sequences (or normal sentences) is not quite that easy as some sequences (or sentence) can have more nucleotides (or letters) than others but I won't go into the details here.

How do these two measures relate?

Let's say that instead of giving you a book, Alice actually produced a copy of its book and gave it to you. The book you have received from Alice (that is 50% of all your Campbell Biology books) is 100% identical to Alice's book in term of mismatch. 

Similarly, the 50% of your DNA that you inherit from your father (or mother) is 100% identical to the copy of the genome found in your mother.

Note however that


Your mother probably made between 10 and 100 mutations when copying her DNA so that the DNA you received from your mother is not exactly 100% identical to your mother's DNA


Similarly Alice could have miscopied her Campbell Biology book that she passes to you

Your mother actually recombined her two haplotypes


Similarly Alice actually had two different editions of Campbell Biology and she mixed them up a little bit before copying the resulting book!