Alternation of generations is a life cycle that includes both diploid and haploid multicellular stages. Remember that 'diploid' means 'two sets of chromosomes' and is commonly abbreviated as 2n, where the n stands for 'chromosomes.'
The life cycle of gymnosperms consists of regular alternation of generation between the diploid sporophytic phase and the haploid gametophytic phase.The plant body which represent the diploid sporophyte. It can produce haploid spores in the sporangia through the meiosis. The microspore forms the male gametophyte and the megaspores form the female gametophyte(So the gametophytes are haploid)
Later the male and female gametophyte produces the male and female gametes(both are haploid) respectively. During fertilizations the male and female gametes fuses to form the diploic zygotes. It undergoes division and form the adult plant which represents the diploid sporophytic phase there by completing the life cycle.