There’s a big difference, so you’ve asked a very good question.
The more common phrase is probably “two days before.” Since “before” is a preposition, it is always followed by an object, either expressed or implied. The object can be a noun, a noun phrase, or a noun clause. If you wrote this question on a Friday, and someone answered it on a Sunday, then we would say “you wrote the question two days before it was answered.” (“It was answered” is a noun clause.) If we say “two days before now” (“now” is a noun meaning “this moment”), that means “two days ago.”
The expression “before two days” is much less useful, in my opinion. It would generally be followed by more information, like “before two days go by” (noun clause). If today is Sunday, then it would mean before (approximately) this time Tuesday. We could also follow “before” with a specific time reference, for example “before five o’clock” or “two days before your birthday.”