Were you supporting the child during those two years? What happened before you gave them temporary custody? Did you have a signed agreement stating that it was only temporary?
In Texas, once a non-parent has custody of a child for 6 months, they have standing to sue for custody. However, you, as the biological parent have superior rights to a non-parent, and if the judge determines that you are not a danger to the child, you should have custody.
This of course, is the big picture. You need to consult a family lawyer in your area, or perhaps Legal Aid and discuss the situation in depth.