Yes — this sentence is grammatically correct.
Step-by-step for a 5-year-old:
- Peacock: a big bird with very pretty feathers.
- 's: means the tail belongs to the peacock (like the dog's toy).
- Majestic: a fancy word that means very grand or beautiful.
- Tail: the long feathers on the peacock's back.
- Sparkles like a rainbow: this is a simile — it means the tail shines with many colors, like a rainbow.
The sentence also starts with a capital letter and ends with a period, which is correct.
A simpler way to say it: The peacock's tail shines with many colors.