Dear Student
The diatomic gas molecules like H2, N2, O2 etc. acts like a monoatomic gas at low temperatures i.e. they have only translational motion (the rotational motion are frozen out at low temperature), hence they have three degree of freedom, thus specific heat is equal to 3/2 R.
But as temperature increases rotational motion comes into play and molecules thus have two rotational degree of freedom also hence in total the molecules have five degree of freedom, hence they have specific heat equal to 5/2 R
On further increasing temperature the atoms of the molecule start vibrating about the axis joining two atoms, thus the specific heat increases to 7/2 R.
Regards