There are two rotational degrees of motion for diatomic gases because one for each of the two axis perpendicular to the cond between the two atoms
The molecules of diatomic and linear polyatomic gases are made up of two atoms joined rigidly to one another through a bond (such as H2). Such a molecule cannot only move as a whole but can also rotate about one of the three co-ordinate axes. However its moment of inertia about the axis joining the two atoms is negligible compared to that about the other two axes. Hence it has only 2 rotational motions