Photocathode RF gun is widely used for particle accelerators as an electron source. When driving an RF electron gun at the fundamental frequency and a higher harmonic frequency simultaneously with proper field ratio and relative phase, it generates electron beams of ultralow emittance and a linear longitudinal phase space distribution. Such a gun provides high quality electron beam with low energy spread, small traverse emittance and high brightness. In this paper, the RF design of a 1.5 cell cavity is presented. Simulation results of beam dynamics for the two-frequency gun and a standard single-frequency RF gun are also shown in this paper. In addition, bunch compression with a two-frequency gun is explored.