Guinea pigs as a rule don't usually bite (although there are always exceptions)
If he's biting, it will probably be because he is trying to tell you something:
I don't like that, don't do that.
I'm feeling scared
I've had enough, I want to go back into my cage
That hurts, please stop
I don't feel safe.
I'm in pain, I need to go to the vet.
If you have ruled out pain as a factor and know he is healthy (vet check) then see below for some tips.
If you can try to learn his warning signs before hand or figure out when it is that he bites you, you can figure out what it is that's causing the problem and learn to avoid it.
Does he make a certain noise before he bites, back away, make a certain movement with his body?
Is it when you do something specific - stroke his head, stroke his bum, offer him a treat.
Is it at certain times (e.g when around children, other pets, loud music etc)
Is it possible that you are mistaking happy noises for angry warning noises? (Very easy to do and a lot of their noises do sound similar)
Is it after he has been out for a while and is trying to tell you he has had enough?
You can try to stop him biting by only getting him out for 5 minutes at a time, giving him some treats (green peppers, kale, parsley etc) and putting him back into his cage before he bites you - this way, he will learn to associate you with good things and will hopefully learn not to bite.
Also ensuring that you don't put him straight back into the cage / put him down if he bites - or he will learn that if he wants to get down or wants to go home, all he needs to do is bite.
Sorry for the long post, got carried away, might all be rubbish, but I hope some of it helps