A habeas corpus petition attacking a criminal conviction or sentence shall be filed within two years from the date of final judgment in the trial court. To use this form, you must be a person who is or will be serving a sentence under a judgment against you in a state court.Habeas corpus is available to prisoners challenging their convictions and sentences. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. Though subject to different rules, incarcerated people in both state or federal custody may petition for a federal writ of habeas corpus. What Is Habeas Corpus? Eastern District of Virginia. Federal prisoners in US Marshals custody may lawfully be transferred to the custody of a state or local government pursuant to a state writ of ad prosequendum. This petition, called a writ of Habeas Corpus, is filed in Federal Court (US District Court ) whether you are serving time in a federal or state prison. 1 (The term "federal law" includes not only federal statutes, but also U.S. treaties and the.