1) /lei/ refers to a woman, /lui/ refers to a man;
this when they are pronoun of third singular person
2) when used as the formal expression that substitutes the /tu/, only /lei/
(or the now fading away /ella/, but still used in writing) may be used;
the gender of the listener does not count in this case.