In Erchin 1:3, the Mishna opens with:
הגוסס והיוצא להרג לא נדר ולא נערך.
The "Goses" (one who is about to die) and someone who is about to be killed are not used as either a measurement of worth for what their monetary value is or for what their worth according to the values set in the Torah are.
(my own translation / elaboration)
Kehati says:
הגוסס — הנוטה למות
the "Goses" — one who is about to die
(translation mine)
Now, unusually for Kehati, this... doesn't explain much. It's possible that the term is explained more elsewhere, but here I don't see much about how the Goses is defined.
I Googled the term, and Hebrew Wiktionary defined the term as someone on their deathbed with a fatal illness. However, that doesn't answer how the Goses is defined halachically.
How is a Goses defined according to the halacha?