Use the techniques in this blog post below to create your formula for dynamically sizing the size of partition:
https://kromerbigdata.com/2021/03/04/dynamic-data-flow-partitions-in-adf-synapse/
In my example, I used a hardcoded value for the target file size. But you can use case() or iif() to apply your rule as described above in the size expression.