First, thank you indeed for giving the context of your problem, i.e., describing the deduction system you are using. Too many posts in this forum ask for help in deriving something but don't give the inference rules.

Yours is called Hilbert system. Because it is simple, it is easy to prove facts about it, but it us awful for constructing actual derivations. There are other systems (Natural Deduction and Sequent Calculus) that are much easier to use in practice and that are, in fact, used in a number of theorem provers.

So don't be surprised how awful this looks. I found the derivation using some general method; feel free to ask about it. Obviously, it is much easier to prove that is derivable using the Deduction Theorem twice. The easiest way to construct a complete derivation may be to carefully replay the proof of the Deduction Theorem in this particular case.

So, let's start. I assume that -> is associated to the right, i.e., A -> B -> C is A -> (B -> C). I will refer to the first two axioms as A1 and A2.

Lemma 1. For any formula A, |- A -> A.

Proof.

Consider the following instance of A2.

[A -> (B -> A) -> A] -> [A -> (B -> A)] -> [A -> A]

The two premises are instances of A1.

End proof.

Lemma 2. For any formulas A, B, if |- A, then |- B -> A.

Proof.

Apply A1: A -> (B -> A) to A.

End proof.

Lemma 3. For any formulas A, B,

|- A -> ((A -> B) -> A) -> ((A -> B) -> B).

Proof.

Consider the following instance of A2.

[(A -> B) -> (A -> B)] -> [(A -> B) -> A] -> [(A -> B) -> B)]

The first premise can be taken away by Lemma 1. Then add a vacuous premise A by Lemma 2.

End proof.

Theorem. For any formulas A, B, |- A -> (A -> B) -> B.

Proof.

Consider the following instance of A2.

[A -> ((A -> B) -> A) -> ((A -> B) -> B)] -> [A -> ((A -> B) -> A)] -> [A -> ((A -> B) -> B)]

The first premise can be removed by Lemma 3, the second one is an instance of A1.

End proof.