With which registry? And how old is the stallion?
In AMHR - you cannot register a foal if the stallion is not brought permanent at age 3.
In AMHA - you can register foals sired by stallions that are 3 and 4 years old, but if you are registering a foal born in the stallion's 5th year, it must be brought permanent before you can register that foal.
I believe there is an exception clause and that would be if the stallion is deceased and has been reported as such to the registry(s) but not positive about that.