"Section Three of the amendment, gave Congress the authority to bar public officials, who took an oath of allegiance to the U.S. Constitution, from holding office if they "engaged in insurrection or rebellion" against the Constitution. The intent was to prevent the president from allowing former leaders of the Confederacy to regain power within the U.S. government after securing a presidential pardon. It states that a two-thirds majority vote in Congress is required to allow public officials who had engaged in rebellion to regain the rights of American citizenship and hold government or military office."
That's Section three of the 14th Amendment: https://www.history.com/topics/black-history/fourteenth-amendment#:~:text=The%2014th%20Amendment%20to%20the,era%20to%20abolish%20slavery%20and
Being a criminal does not bar anyone from running and winning the presidency. The Constitution enumerates only three requirements to be President - you must be 35 years old, a natural born citizen and have resided in the US for at least 14 years. In the past, presidential candidates have run for the office from jail. To date, no one who has run for president from jail has won the election , but I bet Trump could!