The rules are here:
https://europa.eu/youreurope/citizens/travel/entry-exit/non-eu-nationals/index_en.htm
In summary:
Entry - on the day of entry, your passport must have been issued within the last 10 years
Exit - on the intended day of exit, your passport must have at least 3 months of...