What is the Lewis Structure for CO?
There is resonance between various Lewis structures as:

$$\ce{:\!\overset{\ominus}{C}#\overset{\oplus}{O}\!: ~&lt;-&gt;~ :\!C=O\!:: ~&lt;-&gt;~:\!\overset{\oplus}{C}-\overset{\ominus}{O}\!:::}$$

The term "valence" is not used much nowadays, and "oxidation state" is used but has a different meaning.

The IUPAC definition of oxidation state requires the oxygen have a -2 oxidation state except in peroxides.  All the oxidation states must add up to 0 for a neutral molecule.  Therefore the oxidation state of carbon in CO must be +2.

There is an IUPAC definition of valence:


  The maximum number of univalent atoms (originally hydrogen or chlorine atoms) that may combine with an atom of the element under consideration, or with a fragment, or for which an atom of this element can be substituted. 


This imposes a unique valence upon each element, as explained in this article, in which case valence is always 4 for carbon.

There are other definitions of "valence" such as:


  The number of hydrogen atoms that can combine with an element in a binary hydride or twice the number of oxygen atoms combining with an element in its oxide or oxides


(Chemistry of the Elements by Greenwood et al.)

According to this definition, carbon would have a valence of 2 in CO.