Just watch the original and sequel trilogy and you'll be fine.
It'd be nice if you watch the last 8 episodes and have deep knowledge about Star Wars characters to understand all of the easter eggs and references in The Rise of Skywalker. However, this shouldn't be necessary.
This movie is a direct sequel of The Last Jedi and the third installment in the sequel trilogy, so you have to watch the last two episodes. Now this sequel trilogy takes place after the events of the original trilogy and the latest movie shows the return of
so you have to watch this trilogy as well. You can skip prequel trilogy and animated shows if you just want to get to know the characters and a few easter eggs in Episode IX.
From Screenrant (emphasis mine),
In mentioning The Last Jedi, the next film up has to be The Force Awakens. This is the movie that kicked off the trilogy and was also directed by Abrams. Any longterm plans he secretly had for the Star Wars franchise that The Rise of Skywalker could address may very well be rooted in what The Force Awakens does. On a similar note, the return of P******** is significant for not only The Rise of Skywalker but the entire franchise. Since he is not seen in the prior two saga entries, knowing what happened to him last would be beneficial. For that reason, seeing Return of the Jedi will go a long way in establishing who P******** is and what he wants.
While these are the most important Star Wars films to see before checking out The Rise of Skywalker, there's sure to be Easter eggs to more movies than just these. Knowledge of the prequels, other original trilogy entries, The Mandalorian, and even animated shows like Star Wars: The Clone Wars and Star Wars: Rebels would be nice, but they aren't necessarily required viewing. So, if you're looking for an abbreviated refresher of the galaxy far, far away before seeing Star Wars: The Rise of Skywalker in theaters, the last three "Episodes" would be the best way to go, along with The Mandalorian episode 7, which contains a small connection to the new film.
However Anthony Daniels, the actor who played C3PO says,
There are only two months to go until Star Wars Episode IX: The Rise of Skywalker hits cinemas. The circle is now complete,” the man behind C-3PO stated to SFX magazine, according to “comicbook.com. “The saga is almost over and the story just about told.”
Daniels urged fans to go ahead and watch all of the eight other movies in the saga. He even specified that you should watch “an episode a week to get ready,” and start with Star Wars Episode I: The Phantom Menace. So, going in the proper order according to the timeline: prequels, originals, then the sequels.
Or you can watch all episodes including Rogue One in chronological order as mentioned here.
There is an appearance of Lando Calrissian, a character from Star Wars Episode V and VI and Solo: A Star Wars Story. However, there doesn't seem to be need of watching Solo: A Star Wars Story, just episode V and VI.