The census if you are looking at the original or a photocopy is a primary source. If it is transcribed to a database even accurately the database is a secondary source. The census had handwritten portions entered by the enumerator (a primary source), but a book or website that converts the handwriting to print is a secondary source.
And my "source" for this is Elizabeth Shown Mills:
The US Census enumerator recorded everything from street address, census coordinates, the date, etc. and what the information provider gave about himself and their family. Primary information need not be accurate. The name spelling for some people may be in error.