Rikki-tikki-tavi enters his story by being washed into the humans'--father, mother and Teddy's--garden. They all become acquainted when Teddy and his parents rescue Rikki-tikki-tavi and he exercises his great friendly and curious personality to "look down between the [Teddy's] collar and neck, snuffle at his ear" and tickle him under the chin. A bite of meat helped the friendship along.
Then, while talking to Darzee the tailor-bird in the humans' garden, Rikki-tikki learns about the presence of the cobra Nag when "inch by inch out of the grass rose up the head and spread hood of Nag, the big black cobra." Nag had eaten one of Darzee's baby birds. Now commences the enmity between Rikki-tikki and Nag, and his wife Nagaina, which leads to their upcoming great battles.
But now, in the garden, Nag and Nagaina try a sneak attack on Rikki-tikki with Nag distracting him while Nagaina leaps at him from the rear. Thanks to a warning from Darzee, Rikki-tikki is faster than Nagaina and escapes to safety at the humans' bungalow where he saves little Teddy from the attack of the fatal Karait snake.
A mongoose is sworn by heredity to fight all snakes. The mongoose is appointed by heredity the protector of the garden creatures and the humans who dwell as friends nearby.
The first great battle between Rikki-tikki and Nag occurs in the humans' bathroom as Nag lays in wait to fulfill his evil plan of killing all the humans to be rid of their new pet mongoose.
Nag said, ... "I will kill the big man and his wife, and the child if I can, and come away quietly. The the bungalow will be empty, and Rikki-tikki will go.''
The musk-rat reluctantly--because of his great fear of Nag--warns Rikki-tikki, and Rikki-tikki is victorious in his attack on Nag:
Chuchundra sat down and cried till the tears rolled off his whiskers. ... "H'sh! I musn't tell you anything. Can't you hear, Rikki-tikki?''
The second great battle comes the next morning when the grieving and enraged Nagaina heads off to slay the big man human in revenge, thinking he had slain Nag. Rikki-tikki's first plan of attack is to destroy all Nagaina's eggs (future cobras). He is summoned to a direct confrontation with Nagaina, though, when he is warned that is on her way to the humans.
After snatching her last egg back from Rikki-tikki, she runs to her underground den into which Rikki-tikki runs in hot pursuit. Darzee is already singing of the death of the great warrior Rikki-tikki-tavi when Rikki-tikki emerges the victor. The humans and garden creatures are safe and all celebrate and sing his praises:
The Coppersmith [bird] ... is the town-crier to every Indian garden, and tells all the news to everybody ... . "Ding-dong-tock! Nag is dead -- dong! Nagaina is dead! Ding-dong-tock!"
I think the one provided by eNotes is an excellent one--in depth and covering every major part of the story. I have provided a link below.