Suppose a Catholic guy marries a non-Catholic outside the Catholic church, then years later they divorce. Can that Catholic guy get married again to someone else (a Catholic female) in the Catholic church?
Canon 1059 of the Code of Canon Law states:
Even if only one party is Catholic, the marriage of Catholics is governed not only by divine law but also by canon law, without prejudice to the competence of civil authority concerning the merely civil effects of the same marriage.
Therefore, the canons concerning marriage in the Catholic Church will be applied to the first marriage.
Now, in this case, the man's marriage will be assumed to be valid in the Catholic Church unless evidence to the contrary is presented:
Marriage possesses the favor of law; therefore, in a case of doubt, the validity of a marriage must be upheld until the contrary is proven.
And therefore, the second marriage would not be valid:
A person bound by the bond of a prior marriage, even if it was not consummated, invalidly attempts marriage.
(Canon 1085, section 1)
However, the Catholic man is free to request a judgment for an annulment of the first marriage. Whether or not this would be granted is uncertain, and I can't comment on it in the absence of additional information about the first relationship; it may depend to some extent on the reasons for the civil divorce. If the annulment is granted (i.e. if it is judged that there was no valid Catholic marriage in the first instance) then the marriage to the Catholic woman would be valid; otherwise not.
The Catholic Church does not allow re-marriage (see Mt 19:6, Mk 10:9, Rom 7:2). The important question therefore becomes, "Was the first 'marriage' a true marriage?" If it was a true marriage, then the Catholic is clearly not free to marry, for you cannot marry again so long as your spouse is alive. If it was not a true marriage, then the Catholic is free to marry, for they are not currently married.
In order to know whether or not the first "marriage" was a true marriage (or what is effectively called a valid marriage in the Church), a case must be brought before the local Church tribunal. If the tribunal finds that the first "marriage" was invalid, then they will grant a declaration of nullity, or an annulment, thus freeing the Catholic to marry.
There are many different grounds for nullity. For example, if one of the parties was forced into the "marriage" and was not free in their decision, this would constitute grounds for nullity.
See Matt Gutting's answer for more specific information from Canon Law.
Which marriages are valid?
From the Code of Canon Law
Can. 1108 §1. Only those marriages are valid which are contracted before the local ordinary, pastor, or a priest or deacon delegated by either of them, who assist, and before two witnesses according to the rules expressed in the following canons and without prejudice to the exceptions mentioned in cann. ⇒ 144, ⇒ 1112, §1, ⇒ 1116, and ⇒ 1127, §§1-2.
Therefore the marriage of a Catholic guy who married a non-Catholic outside the Catholic church is invalid.
What is the Catholic guy to do after the civil divorce and now wanting to marry again to someone else (a Catholic female) in the Catholic church?
Even though objectively the marriage that ended in divorce is invalid, from my understanding, now that Catholic guy wants to marry a Catholic lady in the Catholic Church, the whole matter is to be brought before a Church tribunal dealing with such matters.
If any one saith, that matrimonial causes do not belong to ecclesiastical judges; let him be anathema.
An example of such a tribunal in Hawai'i is: Diocesan Tribunal & Canonical Affairs.
Of course Catholic guy and the Catholic lady ought also contact their parish priest who also ought to know this history. One reason being that because Catholic guy had previously been married not observing Church law, it appears he may have little understanding of Catholic marriage.
It goes without saying that Catholic guy ought to take care of his duties and responsibilities that came about from the marriage that ended in divorce.