How do you beat Kellogg in Fallout 4?

Quick answer: Kill his synth guards first, use cover and keep hitting him when he shows up. He uses Stealth Boys and grenades, so watch for shimmering movement.
Show walkthrough (story spoilers)
Before the fight
Kellogg waits in a room deep in Fort Hagen. He talks to you first; you can also skip the talk and shoot him from range. Bring stimpaks and a strong weapon.
His tricks
Kellogg fights with his pistol and throws frag grenades. He also uses Stealth Boys to turn invisible and stimpaks to heal. Look for shimmering movement when he goes invisible, or use VATS to find him.
Deal with the synths
Synth guards fight alongside him. Kill them quickly so they do not flank you, and stay behind cover. Your companion can draw fire while you focus on Kellogg.
Foreknowledge perk
If you gave Mama Murphy chems, her vision gives you Foreknowledge. It reduces the damage Kellogg does to you by 25%.
Rewards
Kellogg drops Kellogg’s Pistol, his terminal password and the Cybernetic Brain Augmenter. Take the brain implant for Dangerous Minds and see the Reunions walkthrough for what comes next.
