Relationships.

So I've always wondered this. I live in the U.S. & each country has separate laws. If someone is 17 & get involved with let's say a 20 year old & get pregnant. But will be 18 after a month or so of being pregnant or already will be when the baby gets here. Can the guy get in legal trouble for it? I'm not pregnant or anything. I'm just curious. I've always heard different things.