In FCP, share master file. In the dialog set video codec to H.264. If you want a somewhat smaller file, also set format to Computer.
In Compressor, there are several ways; here's one of them/ Add the file. In the Settings pane on the left, click the + button>New Settings. From the drop down, choose Quick Time movie. In the Inspector, click on QuickTime Settings Change button. In the dialog, click Compression Settings and pick H.264 from the long list of codecs that you'll be presented with.
In both FCP and Compressor, there are also ways to produce H,264 in other containers.
Russ