If you have lived in Germany before and are now returning after a period abroad, you should contact the health insurance provider you were last insured with. If you were with a statutory health insurance provider, you can return to that one. Formerly privately insured individuals can also return and are entitled to join the basic tariff.
If you have never been insured in Germany, the allocation depends on the type of employment you last had abroad. The simple rule is: employees join statutory health insurance, while self-employed individuals or freelancers take out private insurance.