The phase transformation in a constrained layer is the subject of this article. The formation and evolution of polydomain microstructure under external stress in the constrained layer are investigated by phase-field simulation and analytically using homogeneous approximation. As a result of simulation, it has been shown that the three-domain hierarchical structure can be formed in the epitaxial films. Under external stress there are two types of morphological transitions: from the three-domain structure to the two-domain one and from the hierarchical three-domain structure to the cellular three-domain structure. The results of phase-field simulation are compared with conclusions of homogenous theory and with available experimental data.