For as long as it takes...
For as long we have a future...
I know how to use them because I heard them being used, but I don't know whether there is a rule or not.
I don't know where you heard the second one, but it is incorrect. For as long as (or just as long as) is the only correct choice from your examples:
As long as (see def. 37) is an idiom which has the following three meanngs:
I'm assuming definition c for the two examples, but definition a also fits the second example. If that is the definition intended, then the for should be removed: