Using classic Outlook for Windows in educational settings
Rules can't do this directly as they run when the message is received or when you initiate them manually.
To automate it, best would be to apply retention policies to the mailbox. Your Exchange administrator can configure this if it hasn't been setup in your environment yet.