lui = esso = egli - please explain when to use each one
Please help clear up some confusion.
I understand that lui = "he" as a subject pronoun and as an object of the preposition, but "Mosalingua" - the app - is including esso and egli as well. I have not been using them thus far. When would I use "esso" or "egli" - I understand for masculine singular, but is there a reason I would use "esso" instead of lui? Or "egli" instead of lui. Are they outdated or something? Please explain in simple terms, Thanks so much! Do I need to worry about using "esso" and "egli" at all? I prefer to use "lui" for people and things. Can I do that?