This blog post explains the Social Security Administration’s guidelines for determining whether someone is currently insured.
https://www.ssa.gov/OP_Home/cfr20/404/404-0120.htm
To be currently insured, a person must have earned at least 6 quarters of coverage (QCs) during the 13-quarter period that ends with the quarter in which they die, become entitled to disability insurance benefits, or become entitled to old-age insurance benefits. However, quarters that are part of a period of disability are not counted, unless the first or last quarters of the period of disability are QCs.