Setting render options from the command line
Command line
One way is to set the properties from the gui, save the file, then render. The settings will be preserved for rendering from the command line.
Note that (as already mentioned by iKlsR) you can set the render output format from the command line with -F:
Format Options:
-F or --render-format &lt;format&gt;
Set the render format, Valid options are...
    TGA IRIS JPEG MOVIE IRIZ RAWTGA
    AVIRAW AVIJPEG PNG BMP FRAMESERVER
(formats that can be compiled into blender, not available on all systems)
    HDR TIFF EXR MULTILAYER MPEG AVICODEC QUICKTIME CINEON DPX DDS

However, it seems H264 is not a valid setting for this argument.
Further reading: https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html#python-options
Python
Another way is to use blender's python API, and run a python script in blender from the command line (see this post), e.g.:
blender --background /path/to/file.blend --python /path/to/script.py --render-anim

or
blender -b /path/to/file.blend -P /path/to/script.py -a

The render resolution can be set with bpy.context.scene.render.resolution_x and bpy.context.scene.render.resolution_y.
The output format can be set to H.264 with
bpy.context.scene.render.image_settings.file_format = 'H264'.
Note on scene values:
You may want to assign the settings for all scenes to avoid confusion with complex setups which use multiple scenes.
for scene in bpy.data.scenes:
    scene.render.resolution_x = 1920
    scene.render.resolution_y = 1080
    scene.render.image_settings.file_format = 'H264'

Note invoking render:
When using a Python script to render you have the choice to...

Pass the --render-anim argument.
Call bpy.ops.render.render(animation=True) directly from the Python script.

Both do the same thing however calling the operator from Python means if the script fails to run, render won't execute, This may be good/bad depending on your use-case.
Calling from Python also gives some flexibility - for example you could call render multiple times with different frame ranges.