In Swedish social insurance are two types of benefits; work-based benefits and residence-based benefits.
Work-based benefits provide benefits for those who are, or have been, employed. This type of benefit is used for, for example, sick leave or parental leave.
In order to be covered by work-based benefits you must be, or have been, employed on a salary in Sweden that will qualify you for SGI (sickness benefit qualifying income). In some cases, income from work in other EU/EEA countries (incl. Switzerland) may also form the basis for benefits.
These include children’s allowance, housing allowance, parental allowance at minimum or basic levels plus dental care benefits.
In order to be covered by residence-based benefits you must meet the requirements necessary to be considered a resident of Sweden. These rules are not the same as those for registration in the population register which in turn is the basis for the right to free medical care.
For those who have worked abroad or are foreign nationals there is more information here.