Have you attempted to (i) look in our Relativity Forum at the existing posts and (ii) learn this first on your own and let us know what you know?
What you are asking is covered in books and whole chapters. It is impossible to teach you a lesson that is often more suited for a classroom. This forum is more effective if you have specific topic, AND if you have first made an attempt.
Your specific question has to do with time-dilation and the so-called twin paradox. So start from the very beginning before you apply this more complicated situation. Do you already know about time-dilation and why it exists?
This should have been posted in the Relativity forum.
Zz.