Deductions & credits

@Vanessa A - Thank you for your reply.
If I sell the home in future, in the below scenario

Home Price -> X
Realtor rebate -> Y

Net Price of the Home -> X - Y = Z

Home sale price -> A

Capital Gains -> A - Z = B

When do I need to show amount B as capital gains? I mean if I sell the home before N number of years, what is N?