The aim of this paper is to show that procedure of maximum entropy principle for closure of moments equations for rarefied monatomic gases can be extended also to polyatomic gases. The main difference with respect to the usual procedure is existence of two hierarchies of macroscopic equations for moments of suitable distribution function, in which the internal energy of a molecule is taken into account. The field equations for 14 moments of distribution function, which include dynamic pressure, are derived. The entropy and the entropy flux are shown to be a generalization of the ones for classical Grad's distribution. The results are in perfect agreement with the recent macroscopic approach of extended thermodynamics for real gases.