In the most recent episode of Ahsoka we saw The Clone Wars in live-action, with Anakin Skywalker fighting alongside his padawan, Ahsoka Tano, on the field of battle. We got glimpses of two different battles, one near the beginning of the War and the other at the end of the War, and in both cases we saw a very significant character making his live-action debut.
Captain Rex (later promoted to Commander) shows up in two different phases of clone armor, and he speaks to Ahsoka at the Siege of Mandalore (voiced by Temuera Morrison) as he leads the troops further into battle. It’s a minor role, but one of particular significance to Star Wars fans because Rex is a major player in The Clone Wars series, and he’s shown up in Rebels and Tales of the Jedi as well, emerging as a fan favorite.
So who is Captain Rex?

Rex was the clone captain of the legendary 501st legion, which was under the command of General Skywalker during the Clone Wars. Rex was among the earliest group of clones created by the Kaminoans for military service, and given his high rank and his command of the 501st Rex participated in a number of significant conflicts throughout the War, including the Battle of Christophsis, the Second Battle of Geonosis, the Battle of Kamino, the Battle of Umbara, and plenty more. Though Skywalker’s command was rather unconventional, Rex was the perfect second-in-command to lead the 501st to astonishing success throughout the War. He developed a close relationship with Skywalker and especially with his apprentice, Ahsoka Tano. Rex also worked very closely alongside Commander Cody, who served under Jedi High General Obi-Wan Kenobi. Rex and Cody had a close friendship and partnership.
By the time of the Outer Rim Sieges near the end of the War, Tano had left the Jedi Order. But she returned to enlist the help of Skywalker and Kenobi in apprehending the renegade Sith Lord Maul on Mandalore, which could prove pivotal to the Republic’s efforts of getting to the bottom of the mysterious Sith threat. She shared a touching reunion with Anakin, Rex, and the 501st, but her request for Republic aid on Mandalore was stopped by a major crisis: in a stunning move, General Grievous had attacked Coruscant and the Jedi had lost all contact with Chancellor Palpatine, causing Kenobi and Skywalker to rush back to the capital to rescue the captive Chancellor (the beginning of Revenge of the Sith). Before they did so, however, Anakin divided the 501st and placed Rex in command of a section of their forces, and Ahsoka and Rex together led this group into battle in the Siege of Mandalore.

While Ahsoka bested Maul in combat Rex led the 501st to defeat Maul’s army. But while en route to Coruscant with their prisoner, Order 66 happened. Rex resisted the order, pleading with Ahsoka to “Find Fives” before turning on the former Jedi. Ahsoka fended off the clone attack and investigated Fives, a clone who had earlier stumbled upon a conspiracy and was killed for it. She pieced together that there was an inhibitor chip in the head of every clone that enabled this turn, so she enlisted some droids to remove Rex’s chip. Together, Ahsoka and Rex fought off the waves of the 501st still loyal to Order 66, and they escaped.
In the aftermath, Rex ran a network of clones looking to defect from the Empire, traveling the galaxy to aid other clones in need. After a while of this, Rex settled down to a quiet life of retirement on Seelos… until Ahsoka, now working for the Rebellion, sent the Ghost crew to retrieve him. Rex joined the Rebellion, fighting in the Battles of Atollon and Lothal, among others, and he also served as a commander under General Han Solo as part of the strike team to the forest moon of Endor during Return of the Jedi.

Rex was an extremely skilled warrior and an even better leader, always seeking to do what was right in the fight for good and working closely alongside his friends in the cause. From the Clone Wars to the Galactic Civil War, Rex was a major hero.