Not a trivial exercise: you can do it manually, by timestamping changed records, and keeping archive details of the state before they were changed, or you can use
SQL Change Data Capture[
^] - but neither is simple: you will need to be pretty careful about how you handle your DB in order to maintain data integrity.