An Identical-By-Descent (IBD) value is the number of alleles which are the same because of descent from a common ancestor. Since each (diploid) individual has two alleles for a given (autosomal) gene, the number of them that are IBD with another individual can only be 0, 1, or 2.
In your example, X and Y inherit each of their alleles from A2, so their IBD value is 2. Inbreeding is just an extreme form of descent from a common ancestor; it causes on average greater probability of high IBD values than when comparing less-inbred individuals. See the passage here for more detail.