The rent paid can be offset by expenses related to renting. Assuming the girlfriend is effectively renting half the condo then the rent she pays (which counts as rental income for the boyfriend) can be offset by half the deductible expenses.
Those expenses include depreciation, property tax, mortgage interest, homeowners insurance, repairs, utilities, condo/HOA fees, etc.
If half of those expenses exceed the rent income received then the difference is your rental loss. Since you actively participate up to $25,000 of rental loss is deductible (meaning it can offset ordinary income from your W2) if your modified AGI is under $100,000. The maximum deductible rental loss phases out, so if your modified AGI is over $150,000 you can't deduct any rental loss. The exception is if you are a real estate professional, in which case you can deduct all losses regardless of income.
Losses that you can't deduct aren't necessarily wasted, they can be carried forward and potentially used in the future.
When you rent a property it is expected that you deduct depreciation expense, depreciation is re-captured when you dispose of the property, and renting adds complexity to a tax return (though fairly easily managed via modern tax-software). Many people opt not to charge their significant others rent when living in the same house, but instead share living expenses in other ways like paying utilities directly, buying groceries, etc.
You can collect rent and not record the income/expenses if it is not for profit, this requires that you be renting below fair market value.