Many DFT codes use pseudopotentials (for the core electrons) and basis set functions (for the valence electrons) in order to solve the Schrodinger equation. This because simulates each electron wavefunction is very costly.
The key of KS-DFT is to solve the Kohn-Sham equation. Basically, there are four main classifications in terms of the used basis. You may take a look at this post:When are atomic-orbital-basis (rather than plane-wave) methods appropriate in periodic DFT?. In general, the electrons are partitioned into core and valence electrons and the core electrons are treated with pseudopotential method only when you use the plane-wave basis. The reason is that the wavefunction of the core electrons are oscillating strongly and there are many nodes closed to nuclei, which means you should use many plane waves to expand it and hence lead to prohibitive computational cost.
When should I include semi-core electrons in DFT calculations?
This assumes that you are using a plane-wave type Kohn-Sham solver, such as VASP, in which the partition of valence and core electrons is decided when generating pseudopotential. There are two situations you need to include semi-core electrons (maybe I am missing some situations):
If you want to study the spectral properties of core electrons, you should use the pseudopotential with the inclusion of semi-core electrons.
If you want to perform GW calculations, you will use the pseudopotential with semi-core electrons.
Hope it helps.