Use "so" before an adjective or adverb, with no noun after it: “That movie was so boring.”, “He finished the race so quickly.”
Use "such" before a plural or uncountable noun (no "a"): “I've never heard such excuses.”
Use "such a" before a singular countable noun: “That was such a surprise.”
Notice the difference between those last two: same idea, but excuses is plural (just "such"), while surprise is singular (needs "such a"). That's the whole rule: check whether the noun after it is singular or not.