Zhiqian, yiqian and congqian
之前/以前/从前
以前 can be translated as Before, 从前 is usualy used when telling a story, it can be translated as „Once upon a time“. 以前 can replace 从前 almost in every case, but 从前 can be used only in a specific situations.
从前 can be used only if it stands alone and can not be acompanied by another time expresion.
There used to be a castle before.
对 - 从前在这里有一座城堡。
对 - 以前在这里有一座城堡。
There was a castle two years ago.
对 - 两年以前这里有一座城堡。
错 - 两年从前这里有一座城堡。
以前/之前
以前/之前 can be alo used as a definition of a time in a future as well as in a present. 从前 does not have this usage. For Example:
对 - 我想明天两点以前走。
错 - 我想明天两点之前走。
错 - 我想明天两点从前走。
The difference between 之前/以前 is very easy. 之前 expresses longer time.
实用对外汉语教学语法(pp. 54)
对外汉语教学语法释疑201例 (pp. 3, 5, 7)