So if you take methadone for the past two years can you or can't you have kids?

Yes. Yes you can but you need to get off the methadone first or your baby will almost certainly be affected. .
Fetal withdrawal. Yes, you can have children. However, if you are on methadone when you deliver, the baby will be addicted, too, when it is born. The baby will need to spend several weeks in the hospital to allow the methadone to get out of its system, safely. The healthiest thing to do, is to get yourself off of methadone, first. .