We use them in different cases:
1) nominative: Он учит русский (He studies Russian). Она учит русский (She studies Russian).
2) genitive: Его нет дома (He is out of home). Её нет дома (She is out of home).
У него есть собака (He has a dog). У неё есть собака (She has a dog). - note, НЕГО = ЕГО, НЕЁ = ЕЁ. Него and неё are used with prepositions, unlike его and её.
3) dative: Дай ему денег (Give him money). Дай ей денег (Give her money).
Я скучаю по нему (I miss him). Я скучаю по ней (I miss her).
Just the same - НЕГО and НЕЁ are used with prepositions.
4) accusative: Дети любят его (Kids love him). Дети любят её (Kids love her).
Я обиделся на него (I got offended with him). Я обиделся на неё (I got offended with her).
5) instrumental: Родители им гордятся (The parents are proud of him). Родители ей (or ею) гордятся (The parents are proud of her).
Поиграй с ним (Play with him). Поиграй с ней (or с нею) (Play with her).
6) prepositional: Я говорю о нём (I'm talking about him). Я говорю о ней (I'm talking about her).
_______________________________________________________
Besides, the words ЕГО and ЕЁ are used as possessive pronouns HIS and HER.
Это чей дом? Это его дом. Это её дом. (Whose house is this? It's his house. It's her house).
Hope it helps.