A mole of anything is #6.02* 10^23# atoms or molecules It does not matter what element or compound it is of. It is still the same number of atoms or molecules in one mole. But the atoms or the molecule weigh differently depending on the element or compound.
2 moles of an element or compound is therefore: #2*6.02 *10^23 = 12.04*10^23# atoms or molecules.
Since CO2 is a compound, in 2 moles there is #12.04*10^23# molecules.
Each molecule is made of one carbon and 2 oxygen atoms = 3 atoms in the molecule
So the number of atoms in 2 moles is: #3*12.04*10^23 = 3.612 *10^24# atoms.