One of the most surprising moments in Star Wars: The Force Awakens, his appearance in The Rise of Skywalker wasn't expected because the only people we've seen appear after their death before were the Jedi Force ghosts, so does that mean Han was a Force ghost as well?
Star Wars universe. Force ghosts are usually Jedi who trained and learned the power to retain their identity after death in order to communicate with the living. The ability was first discovered in canon by Qui-Gon Jinn, but Obi-Wan Kenobi, Yoda, and Anakin Skywalker were the only Jedi to have appeared as a Force ghost prior to The Rise of Skywalker.
In Han was killed by his son Ben Solo who had fallen to the dark side and taken the name Kylo Ren. By killing his father, Kylo became stronger with the dark side of the Force.
Force heals Kylo so that he may live.
In the aftermath of their battle, Kylo begins to question himself and his dark side path. During this conflicted moment, Han Solo appears. The two have an almost identical interaction to the one they had on Starkiller Base before Kylo killed him. During the scene, Kylo accepts Han as his father by calling him Dad. From here on out in the movie, Kylo Ren is destroyed and Ben Solo is redeemed.
One of the biggest questions that came from this interaction between Kylo and Han was whether or not Han was a Force ghost or just a memory. It wouldn’t make sense for Han Solo to appear as a Force ghost because he didn't use the Force and didn't have the proper training to return as a Force ghost after death. When he appears, he looks as though he is still alive and standing in front of Kylo instead of being a blue transparent image of himself like a Force ghost would normally look.
Additionally, the interaction the two have is nearly identical to the one presented in The Force Awakens. This gives the impression that Ben is ing the moments before he killed his father, a memory that has haunted him ever since. This is why Han in The Rise of Skywalker is only a memory. Ben is simply ing this moment so that he can come to with what he did in order to return to the light side.
The fact that he's a memory projection by Ben is very important to Ben's arc. If it were a Force ghost that helped Ben turn, it would have been a moment of divine intervention to bring him back to the light. The fact that the memory came from inside Ben means the entire dialogue with Han was internal and Kylo's redemption actually came from his own heart.