After surviving the Galactic war, Captain Rex appears in the Battle of Endor. He served on the same shuttle as Luke. However, there is no explicit storyline regarding their meeting. Captain Rex did learn that the “amazing pilot” who destroyed the Death Star was a Jedi named Skywalker though they never showed them meeting.
It can be seen in Legends, Captain Rex never exists once TCW season 6 is over. We have no idea whether he is alive or not. In canon, his last chronological appearance was in Rebels and it ended up in 2 BBY, prior to getting to know about Luke Skywalker. However, we did get confirmation in ROTJ, the rebel with the white beard in the scene with the Rebel Army taking down the shields on Endor was Captain Rex, so served under Luke’s command. As new entries are added and canon changes we may see more interaction between their stories.
Did Rex Die in The Clone Wars?
No. At the end of The Clone Wars, Rex faked his death to escape the Empire. The last scene in The Clone Wars we see of Rex is his face after burying his fellow clones.