Valid means: the sacrament works. It does what it is supposed to do–forgive sins, consecrate the Eucharist, join a man and woman in marriage. The sacrament has a real effect.
Invalid, or not valid, means that sacrament did not work because it was missing some essential element. Sins were not forgiven, people were not married, the Eucharist was not confected.
Illicit means the sacrament worked but it did not follow proper norms. There was some abuse in the way the sacrament was accomplished, but no essential element was missing.
i.e.: A priest, in saying Mass, omits the creed, or the preface, or the Lord’s prayer. That’s illicit. But if he omits the words of consecration, the Mass is not valid. It doesn’t work.