To solve this problem, we first need to define the variables and the objective function. Let's denote the number of youth doses as $y$ and the number of adult doses as $a$. The objective is to maximize profit, which can be calculated as $5y + 3a$ since each youth dose sells for a profit of $5 and each adult dose for $3.

Given constraints are:
1. Total amount of extract used does not exceed 5000 grams: $20y + 35a \leq 5000$
2. At least three times as many youth doses as adult doses are needed: $y \geq 3a$
3. A minimum of 10 adult doses need to be made: $a \geq 10$

All variables are non-negative since they represent quantities of doses.

Now, let's translate this into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
m = Model("Optimize_Doses")

# Define the variables
y = m.addVar(vtype=GRB.CONTINUOUS, name="YouthDoses")
a = m.addVar(vtype=GRB.CONTINUOUS, name="AdultDoses")

# Set the objective function to maximize profit
m.setObjective(5*y + 3*a, GRB.MAXIMIZE)

# Add constraints
m.addConstr(20*y + 35*a <= 5000, "ExtractLimit")
m.addConstr(y >= 3*a, "YouthVsAdult")
m.addConstr(a >= 10, "MinimumAdultDoses")

# Optimize the model
m.optimize()

# Print the results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Youth doses: {y.x}")
    print(f"Adult doses: {a.x}")
    print(f"Maximum profit: {m.objVal}")
else:
    print("No optimal solution found")
```