In The Godfather Part II, how did Michael know that Roth was behind the assassination attempt at his home, and not Frank Pentangeli?
I don't think Michael knew for sure until he overheard Fredo say to someone in a Havana nightclub that Johnny Ola had brought him there on several occasions. Prior to that, Fredo had stated he'd never met Ola. Ola, of course, is Roth's man, so by connecting the dots you can see that Fredo gave info to Ola, who gave that info to Roth. The whole time Michael knew there had to be a rat in the "family", but he wasn't really sure who it was until Fredo made that slip.
We know that Roth confirms that he was behind the hit on Frank P. When he talks about loving Moe and never asking any questions when Moe was killed (by Michael in Godfather I) Roth states,
because it had nothing to do with business.
However, it's never explained how Michael knows that Roth was behind his hit. I believe Michael talked to both Roth and Frank P. to see how they would react when he comes to visit them directly after the hit on his life. Michael flips the script and blames the hit on Frank P. while talking to Roth. Michael says
Frank was stupid, I was lucky. I will visit him soon.
which kind of excites Roth. Roth compliments Michael saying,
You're a wise and considerate young man. Frank Pantangeli is small potatoes.
Michael then says,
Frank Pantangeli is a dead man.
Relieving Roth and also keeping his business deal with Roth intact. He approaches Frank P. totally different. He shows up unannounced and says,
I didn't want you to know I was coming..you know what happened in my home, IN MY HOME!
Frank is just as taken back by the hit as Michael and also is eager to help get rid of everyone behind the hit. Michael then lets Frank off the hook by saying that he knows that Roth was behind the hit. Michael briefly changes the subject talking about him being happy that Frank Frank got his father's house and Him being happy That Frank received the house and not a stranger. Basically relieving letting him know that he still likes him.
Michael then explains that his father taught him to "keep your friends close but your enemies closer." To help Frank understand why he is not going to kill rough and the Resido brothers. Michael wants them to live to not only keep the deal with Roth but also find out who is the traitor in his family, which is more important.