talk to the priest and bring all the relevant info about your marriages. if everything is as described in your short OP, and both spouses were baptized Catholics yet married without the blessing of the Church, both marriages would be invalid due to lack of form. They circumstances of both do have to be investigated, but if your paperwork does show that, it is a much easier and shorter process than a full annulment investigation. The earliest marriage is investigated first, then each subsequent marriage.
If you are not now living with either of your ex’s, or of course with anyone else or remarried, you can proceed with the preparation for the sacraments while these issues are resolved, and you will not be barred from the sacraments. If you have remarried, you must obtain the annulments and regularize the current marriage before you can proceed with RCIA.
It does get complicated, and nothing said here about general cases will apply to any individual case, every situation is unique, and the place to start is with your priest.
I will also warn you against coming to the forums and second-guessing what the priest tells you (this happens quite a lot here) because he is the only one in possession of all the facts. The facts you need to reveal are not appropriate for discussion in this forum.
bottom line: the Catholic Church considers every marriage valid until proven otherwise.
welcome home!