First Check if your headphones work on rear audio panel or not. If they work there then you need to set your Realtek HD Audio to recognise your headphones. Do this:
Open Realtek HD Audio Manager from control panel or from notification area icon(a brown coloured speaker).
On the dialog box just...