Refers to a child born to parents not legally married to each other. The term is legal and somewhat formal; in everyday conversation, 非嫡出子 (ひちゃくしゅつし) or descriptive phrases may be used.
He was born as an illegitimate child, but was later acknowledged by his father.
庶子 refers to a child born out of wedlock, the direct opposite of 嫡子, a child born in wedlock.
The kanji 庶 means 'common' or 'illegitimate', and 子 means 'child'. The word is a Sino-Japanese compound (kango) with a long history in legal and literary contexts.