[quote="Jerok, post:1, topic:214915"]
Or if he has sex, does that make him no longer a priest, and if so can he still perform valid sacraments?
Basically, what sort of sins would do this, if any?
Jerok, even if a priest is in a state of mortal sins, the sacraments he performs are still valid.
When receiving or celebrating the sacraments, the priest is subject to the same requirements of sanctity and state of grace as every other Catholic; that is, the state of grace is required for fruitful reception of all sacraments except those that actually forgive sins.
Therefore a priest who is in a state of mortal sin should seek to confess as soon as possible and refrain from celebrating the sacraments until he has done so.
Normally, to celebrate Mass or receive Communion while in a state of mortal sin would be to commit a sacrilege. Yet, the sacrament would be valid; that is, there would be a true consecration and a true sacrifice.
The reason is: Christ is the principal actor of the sacraments, so they are efficacious even when performed by an unworthy minister. As St. Thomas Aquinas says: Christ may act even through a minister who is spiritually dead.
That's that short answer. The rest of the article goes into more depth.