He does. In the comic Star Wars Tales #6, we see an interaction between Vader and C-3PO. In the comic, Boba Fett brings Vader C-3PO's remains. Vader instantly recognizes C-3PO, and is reminded of his childhood.
Further in Empire Strikes Back, neither Yoda nor Darth Vader recognizes either droid. Luke travels with R2-D2 to the Dagobah where they find Yoda. Yoda's relationship with R2-D2 is not on the same level with the same characters. Perhaps, the old creature simply forgot.
How did Darth Vader not recognize C3PO? Real-world: they weren't connected when the original films were written. Same goes for how he didn't sense Leia's relation to him or Force abilities when standing directly in front of her.
Star Wars Theory: R2-D2 Didn't Know Anakin Skywalker Became Darth Vader. R2-D2 served Queen Amidala and later Anakin Skywalker, accompanied by C-3PO. Unlike the golden protocol droid, R2-D2 never had a full memory wipe, so he was well aware of all events that happened around him.
Yoda recognized R2-D2 during The Empire Strikes Back.
Vader relies on the complex life support system of his suit to survive and it happens to be very vulnerable to electrical discharges. So, if Vader ever had unleashed Force lightning, there's a good chance it would've caused his suit to short circuit, thus, killing him.
It was easy to believe that Darth Vader had kind intentions or a simple code of honor for the Sith, but his plans were much more strategic. Instead, Darth Vader wanted to keep Chewbacca alive because he wanted the Rebels to collectively suffer even more. He wanted them to be weak.
Obi-Wan Was Pretending He Didn't Know R2-D2
A 2017 Reddit theory posted by u/mybustersword adds to that by connecting to the notion of a "companion." It explains that Obi-Wan carefully praises Artoo rather than pretends not to know him, suggesting that he doesn't "own" R2-D2 in the manner that Luke is describing.
Theory 1: Leia Doesn't Remember Ben Is Obi-Wan
Throughout her encounters with Kenobi in the series, he refers to himself as Ben. The most straightforward explanation would be that Leia knows the person who rescued her is Ben, and never connected the dots that Ben is actually Obi-Wan.
His memory was wiped at the end of Revenge of the Sith. A blabbermouth like him can't be trusted with sensitive information.
Do R2D2 and C3PO know that Darth Vader is Anakin? Threepio had his memory wiped at the end of Revenge of the Sith. He doesn't even know Anakin was Anakin.
C-3PO accidentally became part of the Battle of Geonosis when his head was affixed on top of a battle droid's body after a mishap in the Geonosian droid factory. R2-D2 and C-3PO witnessed the secret wedding between Anakin Skywalker and Padmé Amidala on Naboo.
Shortly after the Galactic Empire was formed, Bail Organa had C-3PO's memory wiped clean in order for the droid to not spill any confidential information.
C-3PO had his memory wiped at the end of Revenge of the Sith. R2-D2 did not, but why he never told Luke the truth is actually quite simple. That ends up happening when you make the prequels after the originals lol. Bail Organa had Captain Antilles erase C-3PO's mind shortly after the twins were born.
Yup. In fact he was nearly blown up by him. Anakin Skywalker was aware of Boba after the Battle of Geonosis, but he didn't really pay attention until later in the Clone Wars. There's a couple episodes where Boba infiltrates and takes down a Venator Star Destroyer to get back at Mace Windu.
In Death Star, it seems the Sith Lord could have discovered Leia's true identity if he'd pursued his hunch. However, Leia's strong-mindedness during Vader's probe denied him the opportunity to discover she was his daughter.
In The Phantom Menace, set 32 years before A New Hope, R2-D2 is portrayed as belonging to the Naboo defense forces, one of three astromech droids deployed for repair duty onboard Queen Padmé Amidala's (Natalie Portman) starship as it attempts to get past the Trade Federation blockade.
By wiping his memory, it allowed the leeway necessary to bridge the logic gap created by the previous two prequel films. However, the same could not be said for R2-D2, who never had his memories erased.
Grand Master Yoda encountered the specter of Darth Bane during the Clone Wars. During the war, in 19 BBY, Jedi Grand Master Yoda ventured to Moraband on a journey to discover the secrets of immortality. He entered Bane's tomb and encountered a fiery vision of the ancient Dark Lord.
In the 2005 prequel film Star Wars: Episode III – Revenge of the Sith, Chewbacca and Tarfful fight in the Clone Wars when their planet, Kashyyyk, is invaded by the Separatist Alliance. They also help Yoda escape the clone troopers that had been ordered to kill him.
Chewie: In the novel, he seems to recognize Obi-wan. In the films, he never meets Anakin and Obi-wan, just Yoda, and never sees him again. Naturally he knew about the Empire-but Han didn't want to get involved.
1 Darth Sidious
As well as being a gifted bladesman Sidious' connection to the Dark Side is extremely powerful, granting Sidious the ability to conduct force lightning.
It's likely Kylo never learned how to summon Force Lightning
He would teach and tell Kylo only what he wanted to, making sure that he stayed within limits and would certainly never get to the point of almost destroying him as Anakin did — therefore neglecting training in Force lightning.
Grandmaster Yoda himself was capable of summoning force lightning in the form of Emerald Lightning. Galen Marek was an extremely skilled user of this Force power, even after his conversion to the light side, rivaling Darth Sidious.