Acetylene has an IUPAC name of ethyne. There are two carbon atoms (since the beginning of the name is 'eth') and there is a triple bond between these two carbon atoms ( since the name ends with 'yne').
That means each carbon atom shares three electrons with the other carbon atom. As a result of sharing, the outermost shell has now 4 electrons of its own, 3 electrons of the other carbon atom. One of the outermost electrons is unpaired. It is shared by a hydrogen atom. This electron from hydrogen completes the octet of the carbon atom.
The same happens with the other carbon atom as well. Hence the formula is