Had unprotected sex 12 days ago but he did not cum inside of me I then got my period the next day now I am having brown discharge could it be pregnany

Maybe. There is always a chance. There is still sperm coming out of the penis without ejaculation. But since you had a period the day after it is not as likely. Brown discharge could be old blood. Take a test to be sure!