Ah it's not that confusing?!
You start at the point where you make a house purchase / self-build, and you should have a purchase or build cost.
You take 20% of this figure.
This is the limit for the purposes of the relief, on your savings. The DIRT you can have repaid to you is capped at the proportion of the DIRT you have paid in the last 48 months up to date of purchase/completion, that relates to the limit.
So you need to figure out how much DIRTable savings you had at any given moment in time throughout the 4 years leading to your purchase completion. If you had more than 20% of the house purchase cost, you pro-rata the DIRT you paid in any periods where your savings exceeded the limit.
While strictly speaking you should probably do this calculation on the basis of number of days, I'd say in practice unless there tended to be wide swings in the balances in your deposit accounts, if you just monthly or even quarterly balances to calculate the pro-rating you'll be fine...
The legislation itself is quite straightforward, as these things go, and I've pasted it below.
266A. "(1)In this section-
‘completion value’, in relation to a dwelling, means the price which the unencumbered fee simple of the dwelling might reasonably be expected to fetch on a sale in the open market were that dwelling to be sold on therelevant completion datein such manner and subject to such conditions as might reasonably be calculated to obtain for the vendor the best price for the dwelling and with the benefit of any easement necessary to afford the same access to the dwelling as would have existed prior to that sale;
‘first-time purchaser’ means a person, being an individual who, at the time of arelevant purchaseor on therelevant completion date, as the case may be, has not, either individually or jointly with any other person or persons, previously purchased or previously built directly or indirectly on his or her own behalf any other dwelling;
‘relevant completion’ means the completion of the construction of a new dwelling, on or after 14 October 2014 and on or before 31 December 2017, to a standard where it is suitable for immediate occupation as a dwelling and the dwelling-
(a) has been built directly or indirectly-
(i) on his or her own behalf by afirst-time purchaseronly, for occupation as his or her place of residence, or
(ii) on their own behalf by more than one person, where each such person is afirst-time purchaseronly, for occupation as their place of residence,
and
(b) is constructed on property conveyed or transferred, on or before 31 December 2017, into the name or names of thefirst-time purchaserorfirst-time purchasers only, as the case may be;
‘relevant completion date’, in relation to arelevant completion, means the date on which the dwelling becomes suitable for immediate occupation as a dwelling;
‘relevant purchase’ means the conveyance or transfer of a dwelling on or after 14 October 2014 and on or before 31 December 2017-
(a) into the name of afirst-time purchaseronly, for occupation as his or her place of residence, or
(b) into the names of more than one person, where each such person is afirst-time purchaseronly, for occupation as their place of residence;
‘relevant savings’ means-
(a) in the case of a relevant purchase, so much of the aggregate amount at any time of any relevant deposits held in the name of a first-time purchaser, individually or jointly with another first-time purchaser only, as does not exceed 20 per cent of the amount of the consideration paid in respect of the relevant purchase by the first time purchaser, or
(b) in the case of a relevant completion, so much of the aggregate amount at any time of any relevant deposits held in the name of a first-time purchaser, individually or jointly with another first-time purchaser only, as does not exceed 20 per cent of the completion value of the dwelling;
‘relevant savings interest’ means relevant interest paid-
(a) in the case of a relevant purchase, at any time during the period of 48 months ending on the date of the relevant purchase by a first-time purchaser, to the first-time purchaser in respect of relevant savings, or
(b) in the case of arelevant completion, at any time during the period of 48 months ending on therelevant completion date, to thefirst-time purchaserin respect ofrelevant savings.
(2) Notwithstandingsection 261(b), appropriate tax which-
(a) has been deducted from relevant savings interest paid to a first-time purchaser, and
(b) would not otherwise fall to be repaid under this section or any other provision of the Tax Acts,
shall be repaid to the first-time purchaser on the making of a claim by that first-time purchaser to the inspector in that behalf."