how old does the youngest person have to be to make it legal
Family Law Attorney
16 is the age of consent, unless the "adult" is in a position of power, authority, or control (teacher, coach, counselor, etc.)
Responses are for general information purposes only, and are based on the extremely limited facts given. A consultation with an attorney experienced in the area of law(s) indicated in the question is highly recommended. Information and advice given here should not be relied upon for any final action or decision, as the information is limited by its nature to the question asked and the fact(s) presented in that question. THIS RESPONSE DOES NOT CREATE AN ATTORNEY/CLIENT RELATIONSHIP, particularly considering that the names of the parties are unknown.
Child Custody Lawyer
The mere fact that you feel it necessary to ask the question suggests you should get a lawyer. Different rules apply to minors having sex with other minors, and though the "age of consent" is 16, it's still a possibility that a rape charge can be brought even if the minor is almost 18. Get a lawyer.
Personal Injury Lawyer
You can technically have sex with a person 16 years of age or older, but there are crimes you can be charged with in a relationship situation with a minor. For instance, you can be charged with contributory deliquency or luring a minor. Be very careful. My advice is to pretend the age of consent is 18 and only have sex with people who are legal adults. It becomes very complicated if you go below that age.
Ironically, I get this question a lot in my practice. The law is designed to allow dating a minor 16-18 years of age only with parental consent, but does not come out and explicitly say it.
Act with extreme caution. My advice is to only date adults.