The big twist that reveals the murderer...How can it be done?

I'm still in the earliest stages of planning a trilogy, and, throughout each book, my MC reveals the players of the game. The last person in need of discovering is the murderer himself—the one who executed the fatal blow. This moment, which is a mixture of "Ah-ha!" and "What!?", occurs in the final book. The murderer, however, is someone that has been present throughout the trilogy, and he's a very kind character(after having repented from a rebellious past).

So, I'm at a loss. How do I give him that sense of "eligibility" for committing the murder, so as not to make this "Ah-ha!" moment seem completely random...like I pulled it out of my bum that very second? I understand I have to knit certain hints throughout the trilogy, but I'm not so sure how many "hints" is enough to have the "Ah-ha!" moment make sense.

If you need a little more info, I can give you this:
John(the murderer) was raised in a prominent—and corrupt—political family. His father was in one of the highest ranks of the hierarchy and expected John to follow in his footsteps. However, to join the ranks you have to be "initiated". This initiation is the execution of a criminal(whether they are actually a criminal or have just managed to piss off prominent members of the gov.). John, pressured to make his father proud, was taken to his target and egged on to commit murder...and he did. However, the experience was so disturbing that he completely disowned his family and moved out of the city once of-age.
The man he murdered happened to be the father of his future friend(who he did not know to be associated with the man). His friend, as a teenager, made a pact to kill every man who ever ruined his life. The friend, too, had no idea John was involved.

I think you can take it from there. I'm leaving a lot out, by the way.
Thank you for your advice!

I've never written a murder-mystery myself, but the way I would approach it is like this:

1. Write out the murder scene in great detail. It shouldn't be too simple (e.g. John just shoots the guy), and involve some preparations, tools and objects (rope, knife, duct tape, syringe with anaesthetic or toxin or something). Maybe the victim is aneasthetized first, transported to some empty building in the trunk of a car, carried up some stairs, then tied to a chair in an empty room, then made to talk to the murderer (who may be wearing a ski-mask?) for some time when he wakes up (maybe a bottle of cold water is splashed in his face?), and then finally snuffed in a way of your choosing. Every little detail should be noted in this account, and very explicit.

2. There should be something or some "things" about the murder that is unmistakeably John's doing. Perhaps John is left-handed, and thus hits the victim on a particular side of the head to shut him up when he begs to be freed? Or John popps pills with a bottle of water (to stay calm?) before the act, and unwittingly drops a pill on the floor at the crime scene, crushing it into the concrete ground with his left or right boot? Crime scene investigation later notices a small amount of fine, white, crushed powder on the floor in the shape of a boot sole? They can't tell whether it belonged to the murderer, or was left there by junkies that sometimes do drugs in that building? Maybe John f%%ks up and drops something else at the crime scene? Maybe he bumps/knocks over something while fleeing the scene, and this leaves a clue behind? Dunno.

3. Now drop subtle hints throughout that link John to the murder... but not obvious enough for people to think "Oh easy, John did it." Maybe John has a nervous tick - he cracks his knuckles when under pressure, or pulls on his right earlobe, or something like that - and the murderer did just that at the crime scene? (To not make this too obvious, maybe other characters should have similar tics, so people don't think its very important when they read about it, and jump up and say "OMG, its John!")

4. Only when John is actually outed as the murderer at the end, should all those hints come together and make up a clean picture of "who did it". People should ideally think "Damn, it was right in front of my eyes, but I never suspected that 'kind John' of all people could be the one who did it".

5. It might help to have a/some distraction-character(s) in the plot, who you make the audience sort of "believe" could be the killer... But it turns out that this/these character(s) actually didn't do anything wrong, and it was John who carried out the horrible killing.

I don't know if that helps you at all... I've never written a murder-mystery myself, so I'm not an expert on how to set up this kind of "last minute twist".