Violent criminals can be deported immediately, those on welfare should be next (but given enough time so they can at least save up money and not end up homeless when they reach their original country), then those not working should be deported, then lastely those working should be given a chance to self deport or promise a self deportation timeframe.
Mass deportations of this scale 20-30 million people should be done over the course of a decade at the minimum. I'm against illegal immigration but also against crashing the economy or dumping our illegal immigrants back in their home country without a plan or safety net.