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 firstname.lastname@example.org.
You need to populate some ad attributes.
Proxy Address: SMTP:email@example.com & smtp:firstname.lastname@example.org
Target Address: SMTP:email@example.com
So after those attributes have been synced via dirsync run this powershell command in the exchange management shell
Enable-RemoteMailbox firstname.lastname@example.org -RemoteRoutingAddress email@example.com
So once this is done all you need to do is apply a license and usage location to firstname.lastname@example.org
And then the GAL will be populated between Exchange On premise and Exchange online.