Shape of C₂H₂ molecule
According to VSEPR theory, each carbon has 2 electron "pairs".  These electron pairs are not what you would typically think of as electron pairs because VSEPR theory considers double bonds and triple bonds to still be a single "pair".

So considering each carbon atom, the shape is $AX_2E_0$ ($A$ is the carbon atom, $X$ is a bonding pair of electrons, and $E$ is a non-bonding pair (lone pair) of electrons).  

$AX_2E_0$ corresponds directly to a linear molecule.  

To directly answer your question, when trying to determine the shape of a molecule, consider double and triple bonds as only a single electron bonding pair.