Quoting from here,
In C, there are two different namespaces of types: a namespace of struct/union/enum tag names and a namespace of typedef names.
But the crucial point on your examples isn't about namespace, but the scope of the names.
In name.c, both long2 are "ordinary identifiers" (share the same name space), and both of them are defined in the same scope, so there is a conflict. (C99 §6.7/3)
If name2.c, the local variable four is in a scope deeper than the function four, so the variable hides the function four (C99 §6.2.1/4).