No, that's not how GDP is determined. GDP, or Gross Domestic Product, is determined in several alternative (theoretically similar) ways.
Production Approach: GDP is the sum total of the "market value" of all goods and services produced in the economy over a given time period (usually a year).
Income Approach: GDP is the sum total of all incomes earned by individuals and businesses, including wages and profits in a given time period.
Expenditure Approach: GDP is the sum total of all expenditures or spending made in the economy, typically given in the equation $C + I + G + (X - M)$ where $C$ = Final consumption of individuals and businesses but importantly not spending between individuals like your scenario, $I$ = Investment by businesses, $G$ = Government spending (including gov investment, $X$ = Value of exports, and $M$ = Value of imports.
GDP became the dominant metric for conducting comparative analysis of the growth between nation states in the late 20th Century, replacing the less widely used Gross National Income (GNI) which is simply the total income earned by a nation's residents and businesses, including any income from abroad. It captures overseas dividends and investment income repatriated to the home economy.
GNI = GDP + (Net \, income \, from \, assets \, abroad \, - \,net\, outflow\, to\, foreign\, assets)
It's important to say that GDP, and indeed most single value economic metrics, is a deeply flawed indicator of a nation's well-being and individual prosperity. It crudely indicates how much is produced by a country but goes no further into how that production is distributed or used. It also fails to account for negative externalities such as pollution and environment or social degradation. It also completely misses out entire spheres of society such as household management and human caring. The modern world, dominated by theoretical economists, kneels at the alter of GDP growth at our peril.