Welcome to the Airtable community!
You can use a variety of date/time comparison formula functions. They are documented in the formula field reference.
Here is one possibility to get you started:
IF( IS_AFTER({due date}, {completion date}), "early",
IF( IS_BEFORE({due date}, {completion date}), "late",
IF( IS_SAME({due date}, {completion date}), "on time"
)))