After divorce, many stepparents' feel that they are helpless in custody matters where they have not adopted their ex-spouse's child or children. Many relationships end after many years of marriage and thus many years as acting as a primary caregiver for the children of an ex-spouse. Stepparents have a genuine interest and right in seeing the children they have helped raise and support.
In determining custody rights for unrelated third parties, courts begin by determining if the individual has standing to sue for custody or visitation. To have standing means to have the right and grounds to sue an individual. To show standing as a stepparent, one must show that they have been standing "in loco parentis" to the child. That is, they have been acting as a parent to them for a length of time. Additional factors for the "in loco parentis" consideration include a showing of shared or sole responsibility for the child's financial, educational, medical, and other general needs. Therefore, if you are a stepparent seeking custody of a child, it is important to gather evidence showing your presence in the child's life and all the support you have offered. Additionally, the length of time is a major factor. Here you will have a stronger case when you have been acting as a parent for a longer period of time.
If you are a stepparent in a situation like this, you should contact a family lawyer immediately in order to pursue a suit in custody. A family lawyer should be able to determine your standing and if you can take action in such a suit.