It depends on his suitability in the priesthood or diaconate for the diocese or the religious institute as judged by the bishop or the religious superior respectively.
Part of this determination will involve examining the cause of the marital breakdown and the conduct of the man. If there are any duties left undischarged to the former spouse (e.g., spousal support) or the children are minors, those factors would have to be resolved. The Church is disinclined to view those with those kinds of current obligations as suitable candidates for holy orders. Then too, the questions of potential scandal and public wonderment would have to be considered.
Depending on circumstances, there may also be other complications in the way of irregularity for orders related to canon 1041, 3º. Your scenario did not raise this possibility, but it is not that rare.
A similar assessment would be required in terms of profession without ordination into a religious community.
DISCLAIMER: Catholic Answers has turned over the archive to Catholic-Questions.org and no longer owns, manages, or moderates the forums. For additional apologetics resources please visit www.catholic.com.