As per one of my previous posts HERE on how to edit active directory attributes , When dirsync is enabled it wont populate the GAL with exchange online and exchange on-premise.
Lets say my email address is sean@contoso.com.
You need to populate some ad attributes.
Proxy Address: SMTP:sean@contoso.com & smtp:sean@contoso.mail.onmicrosoft.com
Target Address: SMTP:sean@contoso.mail.onmicrosoft.com
UPN:sean@contoso.com
So after those attributes have been synced via dirsync run this powershell command in the exchange management shell
Enable-RemoteMailbox sean@contoso.com -RemoteRoutingAddress sean@contoso.mail.onmicrosoft.com
So once this is done all you need to do is apply a license and usage location to sean@contoso.com
And then the GAL will be populated between Exchange On premise and Exchange online.