I know the USB-C audio standard support multiple compression standards, some lossy, some lossless.
Can i control this in software or hardware ? how can i choose earphones that will guarantee lossless audio ?
After reading the USB Basic Audio Device Description (BADD) standards document as mandated to be supported by USB-C headphones:
As a device, you get to describe the PCM format you accept. Only define to accept uncompressed, and you should be fine.
By the way, I wouldn't assume anyone implements compressed audio for headphones – makes little sense, since at 44100 Hz stereo uncompressed, the data rates resulting are practically negligible (you get a 12 Mb/s bus all to yourself...), and the fact that under almost all circumstances, the USB-C host would need to re-encode the data to the compressed format would probably negate any power saving due to reduced amount of communicated bits.
Regarding your chances to control that via software on the host: Yeah, your audio driver will most definitely be able to only produce specific PCM types, and uncompressed will very likely be the first choice!