Hi sounds like a chronic infection of a gland.He might have to go on a different course of stronger antibiotics.It sounds like an infection as it cleared up the first time.
When you take him back to the Vets they might take a swab and find out what this infection is most sensitive to and take it from there.
You do not say what age your dog is as that can make a difference.