A321
Flight Crew Instrument; Flight Crew Multiengine; Flight Crew Air Transport Pilot (ATP)
Confusion; Situational Awareness
Deviation / Discrepancy - Procedural Published Material / Policy; Deviation / Discrepancy - Procedural FAR
Company Policy; Human Factors; Staffing
On arrival the First Officer and I were scheduled to deadhead on a flight from ZZZ to ZZZ1. At departure time; while seated in our seats on we were approached by the boarding agent and advised to remove all our personal belongings and proceed off the flight and advised by the working First Officer to call scheduling. The working pilots received an ACARS notice for us to call scheduling.After deplaning and calling scheduling; the crew tracker advised the First Officer and I that we were to operate a flight from ZZZ to ZZZ2. The First Officer and I proceeded to the new departure gate and flew the flight to ZZZ2 after the ongoing maintenance delay on the aircraft was resolved. Later; on the following day; the First Officer and I were advised that our FDP (Flight Duty Period) ended after landing in ZZZ and that because we did not receive the ten hours minimum rest from the previous arrival to the ZZZ2 departure we were both in violation of FAR 117.3 crew rest rules. I did not know about the FDP ending after the live leg and PRIOR to the deadhead. Crew trackers do not understand how to apply FAR Part 117 regulations. The duress placed upon the First Officer and I to deplane [the deadhead flight] seconds prior to door closer placing me in a haste to operate the flight to ZZZ2.I suggest employing crew trackers that know what they're doing and ensure they follow policies; procedures; and regulations. Hopefully a brief narrative of this event will be provided so that other pilots will be informed of the live leg to deadhead requirements when being rescheduled.
A321 Captain reported a crew scheduling error that had them exceed their duty period.