Here's where Lando Calrissian was during the Star Wars sequels before his appearance in The Rise of Skywalker. A key selling point of the sequel trilogy was the nostalgia of seeing iconic characters like Luke Skywalker, Han Solo, and Princess Leia on the big screen again, but some familiar faces were initially missing from the festivities. Despite having key roles in The Empire Strikes Back and Return of the Jedi, Lando wasn't even mentioned by name in the new trilogy's first two installments. This wasn't for lack of trying, however. Rian Johnson wanted to put Lando in The Last Jedi, but couldn't make it work.
It wasn't until The Rise of Skywalker when Billy Dee Williams suited up as Lando one more time, having a small part in the saga finale. He didn't have a lot of screen time, and the movie didn't cover what he was up to during the events of the other films. Fortunately, non-movie canon materials, like the Rise of Skywalker novelization, fleshed out Lando's history a bit more, and it paints a rather sad picture for the former scoundrel.
In The Rise of Skywalker, Rey, Finn, Poe, and Chewbacca meet Lando on Pasaana, which is where Lando called home over the course of the sequel trilogy. As a means of coping with the immense grief he suffered after his daughter was captured by the First Order, Lando went to the desert world to live a peaceful life amongst the Aki-Aki. It's unknown exactly how long he spent on Pasaana, but seeing that the Star Wars sequel trilogy only spans a single year, it's reasonable to assume that's where he was during The Force Awakens and The Last Jedi.
The hermit lifestyle is a far cry from the debonair Lando seen in the original trilogy and Solo, but it illustrates how much people can change over time - similar to how Luke didn't always stay an idealistic hero. In some respects, it might have been odd if Lando was the same freewheeling, carefree smuggler in his elder years. His overall arc also contrasts from Han and Leia, who reverted back to what they always did best (swindling the galaxy and leading a rebellion, respectively) following their own traumatic parental experience. It shows everyone deals with tremendous loss in their own way. Lando felt the best thing to do was to get away from war and conflict, spending time with a friendly alien race. That was until the Resistance needed help, and Lando assembled a makeshift navy.
The additional details learned about Lando in the Rise of Skywalker novelization can come across as Lucasfilm using the book as a means to "fix" perceived flaws with the movie (Lando's role isn't fully developed in the actual film), but it does help explain why he wasn't present for The Force Awakens and The Last Jedi. For understandable reasons, Lando stepped away from the fighting and settled down so he could carve out a new life. Even though he wasn't going on exciting adventures, this little bit adds some depth to Lando's character and makes his moment at the Battle of Exegol more triumphant.