My headphone makes really soft but annoying noises when I plug it into the front audio ports, so I put it in the "line in" audio port in the back. (already tried switching the front audio ports/cable to the mobo but didnt work, probably something with the mobo itself) I also have a speaker set plugged into the "line out" port. When both individually plugged in it gives no problems, but when they're plugged in at the same time the sound comes out of both the speakers and headphone at the same time and (i think) that they both are seen as 1 device. I use Realtek HD audio configuration
Line In is for input devices, usually used for recording an external source to the computer, but separately from microphone. Headphones is an output device. You would need to plug your headphones into either a front headphone port, or one of the rear surround outputs for rear speakers or center/sub, if your sound card is equipped with those outputs. Even if those outputs are present, not all sound cards have the ability to re-define them as a headphone output.
i found a solution just now, my speakerset is a Z313, and in the "controller" where you can manage the volume and turn the speakers on or off you can also plug in a headphone in it. so now i can easely switch between my headphone and speakers + i dont have that annoying sounds coming from the front audio ports.