We have three guys, me, john and jack.
I know, John and jack are wearing white hats.
So, i have either a black or a white hat.
Same goes for jack and john, they both see only 2 guys with white hats.
If i'd see 2 black hats, i'd knew that i have a white one.
in all other cases, it is unclear if i have a white or a black one.
Jack looks at the hats. He doesn't see 2 black hats, so he has no solution.
John looks at the hats, he knows, he'd either see 2 white or 1 black and 1 white hat. (The "no-solution" cases, since jack didn't have a solution)
If he'd see a black hat on me, john would know that he has a white hat on (cus if i had a black hat on me, and john too, jack would have known that he cannot have a black hat)
Since he's looking at 2 white hats, he also has no solution.
So i know, i don't have a black hat on, since a black hat on me, would have meant, that john would have a solution.
So, after a time I'm sure that Jack and John aren't able to figure out what kind of hat they have, that means for me, i have a white hat on.
i take my educated guess and get free.