In principle, you must not have a criminal record if you want to be naturalized. However, not all previous convictions are really relevant. For example, convictions or penalty orders of no more than 90 daily rates as well as convictions for prison sentences of up to three months that were suspended and not enforced are not taken into consideration. The same applies to previous convictions that are no longer listed in the Federal Central Criminal Register. You can find out more about exemption from punishment for naturalization here.