How use 25 pin connector as Com 2 in laptop?

Pins 2, 3 and 7 are used for communication on your RS232 ports. While other pins are used, most are just for protocol (RTS, CTS, and other pins for more advanced communication)
The link below gives more information on the subject.

http://www.lammertbies.nl/comm/cable/RS-232.html