To change a user mailbox to an Office 365 mailbox in the on-premises Exchange portal, you typically need to perform a mailbox migration from your on-premises Exchange server to Exchange Online. This process is part of Office 365 Hybrid Configuration and involves several steps:
Hybrid Configuration: Ensure that you have a hybrid deployment set up between your on-premises Exchange and Office 365. This involves configuring Exchange Federation and possibly Active Directory Federation Services (AD FS).
Mailbox Migration: Use the Exchange Admin Center (EAC) or Exchange Management Shell to initiate a mailbox migration to Office 365.
Synchronization: Make sure that Azure AD Connect (or a similar tool) is running to synchronize your on-premises Active Directory with Azure AD.
Complete the Migration: After the migration, the mailbox type should change to Office 365 in your on-premises Exchange portal.