My hard rule is to never take a counter offer. I've seen too many friends lose great jobs by taking counter offers only to be unemployed 6 months later.
That's my rule too. Even if I take a counter offer that's 10% more, your boss is always going to be suspicious of you and the relationship is already strained.