Exporting only exports the cached content and not what is only available online.
Caching applies to the entire mailbox. However, you can set sync filters at folder level (Right click folder-> Properties-> Synchronization-> button Filter...) to reduce the amount of data that gets synced for that folder.
Caching a 50GB mailbox into an ost-file is possible and will leave you most likely with an ost-file smaller than 50GB as some parts will be stored in a compressed way within the ost-file.
However, instead of doing this client-side, consider using Retention Policies and/or Retention Tags so the items will be moved automatically within the service.
See: Retention tags and retention policies in Exchange Online